SMART LOW POWER OBSTACLE AVOIDANCE DEVICE · 2013-02-20 · iii SMART LOW POWER OBSTACLE AVOIDANCE...
Transcript of SMART LOW POWER OBSTACLE AVOIDANCE DEVICE · 2013-02-20 · iii SMART LOW POWER OBSTACLE AVOIDANCE...
SMART LOW POWER OBSTACLE AVOIDANCE DEVICE
by
Ernesto Cividanes
A Thesis Submitted to the Faculty of
The College of Engineering and Computer Science
in Partial Fulfillment of the Requirements for the Degree of
Master of Science
Florida Atlantic University
Boca Raton, Florida
May 2010
ii
Copyright © by Ernesto Cividanes 2010
iii
SMART LOW POWER OBSTACLE AVOIDANCE DEVICE
by
Ernesto Cividanes
This thesis was prepared under the direction of the candidate�s thesis advisor, Dr. Abhijit Pandya, Department of Computer & Electrical Engineering and Computer Science, and has been approved by the members of his supervisory committee. It was submitted to the faculty of the College of Engineering and Computer Science and was accepted in partial fulfillment of the requirements for the degree of Master of Science.
SUPERVISORY COMMITTEE: ____________________________ Abhijit Pandya, Ph.D. Thesis Advisor ____________________________ Ankur Agarwal, Ph.D. Thesis Co-advisor ____________________________ Bassem Alhalabi, Ph.D. ____________________________ Thomas Fernandez, Ph.D.
______________________________________
Borko Furht, Ph.D. Chairperson, Department of Computer & Electrical Engineering and Computer Science ______________________________________ Karl K. Stevens, Ph.D. Dean, College of Engineering and Computer Science ______________________________________ __________________ Barry T. Rosson, Ph.D. Dean, Graduate College Date
iv
ACKNOWLEDGEMENTS
I extend my heartfelt gratitude to those who helped me during my education
especially Laura Cividanes, Nereida Cividanes, Dr. JP Keener and Licenciada Maria
Teresa Lebrón. I would also like to thank my thesis committee for constantly being
available to answer questions and providing great support before and during the project.
The efforts of the College of Computer Science and Engineering staff, especially Dean
Mohammad Ilyas and Jean Mangiaracina, are also greatly appreciated.
v
ABSTRACT
Author: Ernesto Cividanes
Title: Smart Lower Power Obstacle Avoidance Device
Institution: Florida Atlantic University
Thesis Advisor: Dr. Abhijit Pandya
Degree: Master of Science
Year: 2010
Several technologies are being made available for the blind and the visually
impaired with the use of infrared and sonar sensors, Radio Frequency Identification,
GPS, Wi-Fi among others. Current technologies utilizing microprocessors increase the
device�s power consumption. In this project, a Verilog Hardware Language (VHDL)
designed handheld device that autonomously guides a visually impaired user through an
obstacle free path is proposed. The goal is to minimize power consumption by not using
the usual microcontroller and replacing it with components that can increase its speed.
Utilizing six infrared sensors, the handheld device is modeled after current technologies
which use IR and sonar sensors which are reviewed in this project. By using behavioral
modeling, an algorithm for obstacle avoidance and the generation of the obstacle free
path is reduced using a K-map and implemented using a multiplexer.
vi
DEDICATION
This manuscript is dedicated to my family, particularly my mother who always
believed that I should push forward regardless of any immediate or pending obstacles life
presented. Also to my wife, Laura and my son Ernesto Antonio who had to endure my
long hours of study during my education. Additionally, I dedicate this work to my
confidant, mentor and friend JP and my aunt Titi Tesi whose guidance has always
inspired me to reach for my dreams.
vii
SMART LOW POWER OBSTACLE AVOIDANCE DEVICE
List of Tables �����.�����.�����.�����.�������
List of Figure�����.�����.�����.�����.�����.��.
CHAPTER 1: INTRODUCTION��������������������.
1.1 Motivation�����.�����.�����.�����.�����.�...
1.2 Problem Statement...�.�����.�����.�����.�����.�...
1.3 Contribution���������������������������.
1.4 Thesis Overview�����.�����.�����.��������.�..
CHAPTER 2: BACKGROUND RESEARCH���������������..
2.2 Technologies using Wheelchairs�������������������.
2.3 Technologies using canes����������������������
2.3 Inspirations for this project�s design������������������
CHAPTER 3: REPLACING THE MICROCONTROLLER����������.
3.1 Introduction���������������������������..
3.2 The Analog to Digital Converter�������������������.
3.3 The Counter/Delay������������������������...
3.4 The Clock����������������������������.
3.4 Switching and power reduction��������������������
3.5 Choosing the right chip�����������������������
CHAPTER 4: THE CODE�����������������������.
x
xi
1
1
2
3
4
5
5
10
13
14
14
15
19
22
23
27
29
viii
4.1 Introduction���������������������������..
4.2 The Smart Wheelchair algorithm�������������������.
4.3 Pseudo code for the proposed algorithm����������������..
4.4 Equations����������������������������..
4.5 The equation using CMOS���������������������...
4.6 The equations using a multiplexer������������������...
CHAPTER 5: THE SCHEMATIC��������������������
5.1 Introduction���������������������������..
5.2 Unused Sensors from Smart Wheelchair����������������.
5.3 Schematic����������������������������.
5.4 The Handheld Device�����������������������..
5.5 Smart Handheld Device functionalities����������������...
5.6 Simulations and results�����������������������
CHAPTER 6: CONCLUSION AND FUTURE WORK�����������...
Appendix A: Binary Representation of Pseudo Code�������������
Appendix B: Smart Wheelchair�s algorithm translated to pseudo code������
Appendix C: Verilog Code for the SHD������������������
Appendix D: Full Compilation and Simulation Reports������������
Appendix E: Gate circuitry for Turn and Speed signal������������..
Appendix F: PowerPlay Analyzer Summary����������������.
REFERENCES���������������������������...
29
29
31
31
35
40
42
42
42
43
46
47
47
51
55
56
58
61
63
64
65
ix
TABLES
Table 2.1: Available technologies for wheelchair designs�����������.
Table 2.2: Classification of technologies using canes������������...
Table 3.1: Difference between two FPGA chips��������������...
Table 4.1: Example of a pseudo code binary representation����������.
Table 4.2: Four test cases for Speed CMOS circuits�������������
Table 4.3: Two test cases for TurnRight CMOS circuit������������
Table 4.4: Two test cases for TurnLeft CMOS circuit ������������.
Table 4.5: Speed MUX logic����������������������.
Table 5.1: Chip voltage and temperature description�������������
Table 6.1: Voltage outputs from IR GP2D12����������������
Table A.1: Pseudo code translated into binary representation���������..
7
12
27
33
36
39
39
40
43
52
55
x
FIGURES
Figure 2.1: Smart Wheelchair Algorithm�����������..������
Figure 2.2: Smart Wheelchair Component System��������������
Figure 2.3: Sensor placement for SW�������������������
Figure 2.4: SW moving between obstacles�����������������
Figure 2.5: Mygo Cane������������������������..
Figure 2.6: �K� Sonar�������������������������.
Figure 3.1: Design of the White Stick�������������������
Figure 3.2: ADC used in the microcontroller����������������
Figure 3.3: GP2D12 output voltage curve�����������������.
Figure 3.4: Comparator chip LM339�������������������.
Figure 3.5: Comparator design���������������������...
Figure 3.6: GP2D12 IR delayed output waveform��������������
Figure 3.7: Waveform for adder��������������������.
Figure 3.8: Waveform of unstable outputs�����������������.
Figure 3.9: Block diagram of MM8512������������������.
Figure 3.10: MM8512 Pin configuration�����������������...
Figure 3.11: Using a multiplexer versus NAND, NOR and inverter gates�����
Figure 3.12: Pin placement on two FBGA board��������������...
Figure 4.1: Flowchart from Smart Wheelchair (SW) algorithm to Mux�����...
8
9
9
9
13
13
15
17
17
18
18
20
21
21
23
23
26
27
30
xi
Figure 4.2: General situations for device�����������������...
Figure 4.3: Speed CMOS stick figure�������������������
Figure 4.4: TurnRight CMOS schematic�����������������...
Figure 4.5 TurnLeft CMOS schematic����������������..��
Figure 4.6 TurnLeft Mux��������������������...���
Figure 4.7: TurnRight Mux�����������������������
Figure 4.8: Speed Mux�����������������������.�
Figure 5.1: General design of SHD������������������...�
Figure 5.2: Design schematic����������������������.
Figure 5.3: Smart Handheld device��������������������
Figure 5.4: SHD approaching obstacle��������������..����
Figure 5.5: SHD path to avoid font obstacle��������������..��
Figure 5.6: Compilation report of MUX������������������
Figure 5.7: Compilation result of combinatorial���������������
Figure 5.8: Waveform for SSH���������������������..
Figure 6.1: Distance measurement of one GP2D12 IR with 3 settings������.
Figure 6.2: Future work with five comparators���������������.
Figure 6.3: Future work with potentiometer����������������..
Figure D.1: Compilation results for SHD�����������������.
Figure D.2: Compilation warnings for SHD����������������.
Figure D.3: Simulation successful window for SHD�������������
Figure E.1: Gate circuitry for Turn and Speed signal�������������
33
36
37
38
41
41
41
44
45
46
47
47
48
48
50
52
53
53
61
61
62
63
xii
Figure F.1: PowerPlay Analyzer Summary for Mux�������������. 64
1
CHAPTER 1
INTRODUCTION
Smart designs have advanced to a point where many of the normal activities
people engage in can be simulated by computers. This includes obstacle avoidance,
obstacle free path generation, geographical localization, among others. Many of these
designs are still in their exploratory phase but are rapidly becoming more available as
speed, power consumption and cost are optimized.
Microprocessors in smart designs have been regarded as good practice for their
cost, versatility and robustness. Such microprocessors allow the interfacing of multiple
sensor chips and power motor driven devices in autonomous based designs. However,
even though the microprocessor has the capability of going into �sleep mode�, increase in
power consumption can occur when some of the chip is powered but not used.
In this project, a smart device is implemented using a low power CMOS design in
order to reduce power consumption compared to those designs using microprocessors
thus increasing the battery life of a hand held obstacle-avoidance and obstacle-free path
generation device.
2
1.1 Motivation
Visually impaired persons who are familiar with their surrounding while at home can
move from room to room avoiding any obstacles in their path. However, when an object
has been moved out of place by another person or visitor, the visually impaired person
runs the risk of tripping over the obstacle and potentially getting hurt. Current
technologies have been developed to aide the visually impaired navigate through indoor
and outdoor environments with predefined paths. Some of these technologies concentrate
on using navigation systems (e.g. GPS for outdoor), location identification (e.g. RFID for
indoor/outdoor), among others to guide the user. Other technologies concentrate on
obstacle avoidance implemented via ultrasound sonar sensors, infrared sensors, bump
switches among others to indicate an obstacle has been detected in the path of the user.
Other designs help users move about their surroundings using a wheelchair which can
autonomously select an obstacle-free path.
1.2 Problem Statement
The goal of this thesis is to design a low power obstacle avoidance and obstacle-free
path generation device for the visually impaired by replacing the microcontroller with a
CMOS design and other necessary components (i.e. comparators, operational amplifiers,
clock, and potentiometers). The behavioral model of an existing obstacle avoidance and
obstacle-free path generation algorithm is used to design the device�s code. Quartus,
produced by Altera, is used to synthesize the design into a CMOS design. An optimal
3
implementation of the design would be via discrete logic. However, for this project, the
CMOS circuit will be burned to a Field Programmable Gate Array (FPGA).
• Assumption 1: Using behavioral modeling, an algorithm from an existing obstacle
avoidance and obstacle free path generation device can be designed using CMOS
technology implemented via a multiplexer in order to consume less power.
• Assumption 2: By replacing the microcontroller with only the necessary CMOS
transistors and other necessary components (i.e. comparator chip, clock,
operational amplifier, potentiometer), power consumption can be reduced.
1.3 Contributions
Different devices are available in the market which can aid a user through indoor and
outdoor environments via GPS, RFID among others. Obstacle detection devices and
obstacle-free path generation devices are available for wheelchair users. However, a low
power handheld device combining an obstacle detection and obstacle-free path generation
algorithm has not been designed to aide the visually impaired move about their home
while avoiding objects which have been misplaced. Current available system designs use
microprocessors which can increase power consumption. This project discusses how to
reduce power consumption using CMOS and some other necessary components (i.e.
comparators, clock, potentiometer, operational amplifier) in order to provide a lower
power smart design which provides a solution for the visually impaired that could benefit
from an obstacle avoidance device that can direct a user through an obstacle free path.
4
The delays associated with infrared sensors are addressed by using nonblocking
assignments in Verilog. In order to implement the design, an FPGA is used. The main
contributions from this project are to design a lower power obstacle avoidance device
which can direct a user through an obstacle free path. The design will be as follows:
• Implemented using CMOS technology
• Does not use a microprocessor
• Algorithm designed to minimize power consumption
• Uses a multiplexer to minimize number of transistors
• Accounts for infrared sensor chip delays
• Device is constructed and demonstrated
1.4 Thesis Overview
The background research of this thesis is discussed in Chapter 2. In Chapter 3 is a
brief overview of how a microprocessor dissipates power and how it can be replaced with
a CMOS design and other necessary components (i.e. comparators, clock, potentiometer,
operational amplifier). Chapter 4 proposes a novel algorithm superior to existing
obstacle avoidance and obstacle free path generation algorithms due to its power
efficiency. Chapter 5 discusses the design, the schematic of implementing the design and
the final product along with the simulation results. Lastly in Chapter 6 is the conclusion
and future work.
5
CHAPTER 2
BACKGROUND RESEARCH
2.1 Introduction
Much of the technologies available for the visually impaired include obstacle
avoidance and obstacle-free path generation algorithms implemented via wheelchair and
walking sticks/canes. These technologies have been researched by several institutions
(professional and academic), for the implementation of a smart device capable of
directing a user through different environments. In this chapter, a review of the
technologies available and not yet available on the market is discussed.
2.2 Technologies using Wheelchairs
Several technologies have been developed for smart wheelchairs. The Computer-
Controlled Power Wheelchair Navigation System (CPWNS) uses vision and dead
reckoning and after the system has been manually driven from a starting point to a goal
point, the wheelchair automatically reproduces that route [Yoder JD, et al., 1996]. Based
on TinMan, the Intelligent Wheelchair uses vision, infrared and sonar for landmark
detection and can autonomously explore an environment [Gribble WS et al., 1998].
Another technology based on the TinMan is the RobChair which uses Sonar, Infrared,
6
and bump sensors to help a user navigate while avoiding obstacles. Using facial features,
a user can send a signal to the Intelligent Wheelchair System wheelchair which is
interpreted by gesture recognition. With this input and inputs from its Vision and Sonar
sensors, the wheelchair responds accordingly [Pires G, Nunes U, 2002]. The TetraNauta
uses vision, infrared, sonar and bump sensors to navigate by following landmarks
[Balcells AC, Gonzalez JA. 1998]. More technologies based on wheelchairs outlined by
[Richard Simpson, PhD, et al., 2004] are listed in Figure 2.1.
The algorithm (Figure 2.2) proposed by [Richard Simpson, PhD, et al., 2004] was
designed for the Smart Wheelchair (SW). The algorithm includes input from the
following: IR sensors, sonar sensors, and the joystick. The IR and sonar sensors are used
for obstacle avoidance and the joystick outputs forward, reverse, left or right per the
user�s request. Figure 2.3 lists the components that make up the Smart Wheelchair
Component System (SWCS) [Richard Simpson, PhD, et al., 2004]. The algorithm uses
the user�s input from the joystick to begin navigating. If there is obstacle present in the
direction the user wishes to go, the wheelchair navigation assistance software will
prevent the wheelchair from moving in that direction. It will then begin to search in
different directions (default to look left first) to determine if that is an obstacle free path.
If it is, it will move the wheelchair in that direction. If it is not possible, continue to
search a possible path. In cases that the wheelchair has wrongfully decided to stop, the
user has the option of overriding the system.
7
Tabl
e 2.
1: A
vaila
ble
tech
nolo
gies
for w
heel
chai
r des
igns
[Ric
hard
Sim
pson
, PhD
, et a
l., 2
004]
.
8
Figure 2.1: Smart Wheelchair Algorithm [Richard Simpson, PhD, et al., 2004]
9
Figure 2.2: Smart Wheelchair Component System [Richard Simpson, PhD, et al., 2004]
The sensors in the Smart Wheelchair include infrared, Sonar and bump sensors.
The general placement of the sensors presented by [Richard Simpson, PhD, et al., 2004]
is shown in Figure 2.3. Using these sensors, the navigation system would be able to
determine if there is sufficient room to navigate between two obstacles as shown in
Figure 2.4.
Figure 2.3: Sensor placement for SW [Richard Simpson, PhD, et al., 2004].
Figure 2.4: SW moving between obstacles [Richard Simpson, PhD, et al., 2004]
10
2.3 Technologies using canes
The walking stick using artificial intelligence has been designed by a group of
student Engineers from Central Michigan University. In the �Smart Cane�, the cane has
Radio Frequency Identification (RFID) technology which communicates with other RFID
which are placed within the walking area and a vibration is sent to the user depending on
the distance between the cane and the RFID tags. A glove is used in order to feel the
vibrations. Each glove finger sends a different vibration to indicate corresponding
distances. Sound, instead of vibrations, is also available through a speaker on the strap of
the bag which comes with the cane. The battery life for the Smart Cane is one week and it
must be charged for one hour [CMU Media Channel, 2009]. The technology has also
been researched by the JRC in the SESAMONET Project [B Barshan, 2007].
The RFID can be summarized by viewing how the user and the device interact and
how the developers must prepare the environment.
1. The user carries the RFID reader
a. Accurate and simple
b. Cost limitations because of reading devices
c. User must carry uncomfortable and expensive device
2. Using an RFID reader in a RFID tagged zone
a. Previous mapping of RFID tags
b. Requires reading infrastructure
c. Requires additional unit
d. Cost limitation if mapping an extended area
11
Another similar technology produced using the same RFDI tags but the �bag� and
�bag strap� is replaced by a PDA and a blue tooth headset [Ugo Biader Ceipidor et al.,
2007]. Since, there has been research done using Ultrasound, WiMAX, UWB, Bluetooth,
WiFi, and GPS. Each of these technologies present a solution with advantages and
drawbacks. Much of the existing research has to do with location and guidance of people
with disability (ELISA project: Entorno de Localización Inteligente para Servicios
Asistidos). For this reason, visual sensing has exited engineers to research further into
how these technologies can improve AI [Zhiheng Li et al., 2009]. In [Zhiheng Li et al.,
2009], the authors explain what visual sensors can do in order to maximize the
effectiveness of AI in vehicle vision systems. Inclusive, lighting, road, and weather
conditions are considered which can also affect the effectiveness of an AI walking stick.
In Table 2.2 is a summary of the functions and operations of several of these
technologies.
12
Tabl
e 2.
2: C
lass
ifica
tion
of te
chno
logi
es u
sing
can
es [Z
hihe
ng L
i et a
l., 2
009]
13
2.4 Inspirations for this project�s design
Mygo Cane (Figure 2.5), designed by student Sebastian Ritzler in 2007 at the
Muthesius Academy of Art and Design in Kiel Germany [Gizmodo, 2007], has the ability
to send real-time information about the ground to the user. Mygo cane has a steering
engine that helps the user steer by providing feedback through the grip and auditory
feedback is sent to the headset. The wheel has a motor which helps the user by moving
the cane forward and has a battery life of 6 hours [The Coolest Gadgets, 2007]. There is
a limited amount of information on this product on its design and functionalities therefore
its ability to avoid obstacles or offer alternate routes is unknown.
Figure 2.5: Mygo Cane [The Coolest Gadgets, 2007]
Figure 2.6: �K� Sonar[AbleData, 2005]
American Printing House for the Blind, Inc designed the 'K' SONAR (MODEL 1-
07000-00) (Figure 2.6) as an electronic obstacle detector which gives the user
information of obstacles via headphone [AbleData, 2005]. This design among other
obstacle detectors does not have the ability to offer the user an alternate route.
14
CHAPTER 3
ARCHITECTURAL SYSTEM DESIGN
3.1 Introduction
The microcontroller performs tasks that are necessary when building smart
devices and radio controlled robots and many other types of designs. However the
microcontroller is a general purpose processing chip which has much functionality that is
not used in most smart designs. Pertaining to the handheld smart device in this thesis, the
necessary microcontroller functions are the following: provide a clock signal, receive an
analog input from the infrared (IR) sensor and convert it to digital, handle delays in IR
signals, and output a signal to external components. By replacing the microcontroller
functions with a CMOS design and other necessary components (i.e. comparators,
potentiometers, a clock and operational amplifiers), a low power design is possible. The
design in Figure 3.1 by [S. Innet, 2008] offers a view of how the microcontroller�s
connects with some of the needed external components needed for the Smart Handheld
Device (SHD) to function.
"By optimizing an architecture for the common functions it performs,
we can not only achieve greater performance, but also get power efficiency by better
utilization of device hardware, efficient use of hardware resources." [Cho, 1994]
15
In other words, the microcontroller is replaced with only the necessary
components [Texas Instruments]. In this chapter the microcontroller�s components
needed for the design are discussed and how can using a CMOS design decrease power
consumption.
Figure 3.1: Design of the White Stick [S. Innet, 2008]
3.2 The Analog to Digital Converter
IR sensors output an analog signal that needs to be converted into a usable digital
signal via an Analog/Digital converter (ADC). The microcontroller has the ability of
receiving these analog inputs and converting them into a 10-bit digital number
[Microchip Technology Inc., 2001]. An IR signal gives an increasing or decreasing
analog voltage output depending on how far or near the object has been detected.
16
Therefore it is necessary to determine whether the voltage has risen above a threshold to
know how close the object is which does not require converting the signal into a 10-bit
digital number. Such long conversion operations take time and energy to complete. By
utilizing a comparator, the voltage can be compared to a predefined voltage signal and
the comparator will output 0 or 1 depending whether the threshold was exceeded.
The White Stick design by [S. Innet, 2008] includes the microcontroller
PIC16F877 which uses an Analog to Digital Converter (ADC) to derive a 10-bit digital
result of the analog input from the IR. The ADC is important because it receives the
analog output from the IR and converts the signal to a usable digital signal. The ADC
operates via successive approximation [Microchip Technology Inc., 2001] with a
successive approximation register (SAR), a digital to analog converter (DAC), a sample
and hold capacitor (S/H), a Voltage In (VIN) and Voltage Reference (VREF) is shown in
Figure 3.2 [Freescale Semiconductor, 2010]. For the SHD, it is only necessary to test
whether the analog voltage signal has exceeded a threshold. Therefore, since the analog
voltage outputs are already known for the IR (as seen in Figure 3.3) reducing the
successive approximation process down to testing whether the voltage has exceeded a
threshold using only the comparator (circled in Figure 3.2) is all that is needed. Thus
power consumption is reduced.
17
Figure 3.2: ADC used in the microcontroller [Freescale Semiconductor, 2010]
Figure 3.3: GP2D12 output voltage curve [Sharp]
The microcontroller Analog/Digital Converter will be replaced by a design that
can compare the analog input with a predefined voltage. The voltages can be compared
(using a comparator chip as seen in Figure 3.4) with predetermined [Sharp IR Rangers
Information, 2008][Innet, S.; Ritnoom, 2009] voltages (Figure 3.3) to ascertain the
18
distances of the obstacles seen by the IR. By comparing the voltages, the analog signal is
no longer an issue since the comparator will output a digital 0 or 1 accordingly.
Replacing the PIC�s ADC is the LM339 comparator (Figure 3.4). This chip uses minimal
power while providing a logical 0 or 1 depending on whether the IR_OUT voltage is less
or more than the input voltage [National Semiconductor].
Figure 3.4: Comparator chip LM339 [LM339]
As seen on Figure 3.5, the comparator chip will connect between the IR and the
new chip. The main concern here is converting the analog output from the IR to a usable
digital signal.
Figure 3.5: Comparator design
19
3.3 The Counter/Delay
The microcontroller handles delays associated with the IR signals. After turning
on the IR sensor, there is a time where the output is unstable and needs to be ignored.
After a good output from the IR, there is another delay while the sensor propagates
another voltage signal which is also unstable. Although this delay is far shorter than the
initial one, it must also be considered. The microcontroller offers the feasibility of
interfacing with infrared sensors by allowing the designer to easily manage the delays
associated with the sensors and converting the analog input from the IR to a usable digital
input. These are important aspects of dealing with an IR that must be handled and
addressed with the CMOS design.
The IR delay to startup is ~38.3 ± 9.6 ns and the delay for a stable output is 5 ns.
Therefore the Verilog design will have to account for this delay by reading from the
comparator at the appropriate times (Figure 3.6). The microcontroller can delay the
amount of time necessary to gather stable inputs from the infrared sensors. Verilog has a
similar ability by adding a delay to the code. As an example proposed by [Cummings,
1999], Algorithm 1 below receives inputs from devices that have delays so it is designed
to only calculate the output 12 ns after all the inputs are stable.
20
Figure 3.6: GP2D12 IR delayed output waveform [GP2D12, datasheet]
This type of assignment is called a right handed side (RHS) Nonblocking
assignment since the right hand side of the equation is delayed before entering the
information into the left hand side.
module Adder (Carry_Out, Sum, a, b, Carry_In); output [3:0] Sum; output Carry_Out; input [3:0] a, b; input Carry_In; reg Carry_Out; reg [3:0] Sum; always @( Carry_In or a or b) {Carry_Out, Sum} <= #12 a + b + Carry_In; // Nonblocking endmodule
Algorithm 1: RHS Nonblocking Assignment
[Cummings, 1999] discusses the waveform simulation (Figure 3.7) from
Algorithm 1 and shows an always block being triggered by a change in any of the inputs
a, b, or Carry_In. Then there is a delay of 12 ns before calculating the outputs. The
always block is triggered with each change in the inputs. Using this type of delay will
allow the device to first receive all stable inputs from the comparators (which are
21
receiving the analog inputs from the infrared) before calculating the direction and speed.
Since the infrared sensors go through 5 ns delay before having a stable output, the device
will have to sample the outputs until they are stable. As seen on Figure 3.8, an
improperly designed code can have unstable outputs.
Figure 3.7: Waveform for adder [Cummings, 1999]
Figure 3.8: Waveform of unstable outputs
22
Proper blocking technique will ensure that all the inputs are stable prior to
calculating the speed and direction. The algorithm for the individual IRs would be as
follows:
1. Turn_Device_ON 2. WAIT(IR_START_TIME) // IR needs time to send out its infrared signal 3. WAIT(IR_GOOD_SIGNAL_TIME) // IR needs additional time to produce a
// good output 4. WHILE(Device is ON)
a. READ OUTPUTS b. WAIT FOR IR_DELAY
5. end
IR_START_TIME and IR_GOOD_SIGNAL_TIME will vary pending on the IR chip
used. For the GP2D12 used in [S. Innet, 2008], the delay is 38.3ms ± 9.6 ms and an
additional 5.0ms in between readings respectively.
3.4 The Clock
A 10-MHz crystal generates the clock signal for the microcontroller [J. R. Fisher
& Carla Beaudet, 2005]. The designer can choose between 32 kHz, 100 kHz or 200 kHz
depending on which clock frequency is necessary for the external component. Since the
IR nor the comparator [LM339] require a clock [Sharp] [National Semiconductor], there
is only a need to add a clock to the CMOS design. This clock can be replaced by the
MM8511-12[Mobius Microsystems] (Figure 3.9 and Figure 3.10) which has a monolithic
die thus eliminating the quartz crystal, reduces clock jitters, removes bulky packages
from the system, reduces electromagnetic interference and improves performance by
23
reducing peak electromagnetic interference (EMI)[Mobius Microsystems]. However,
how the clock can optimize power performance is beyond the scope of this project.
The GP2D12 IR does not need an external clock. Once it is powered, it will
continue to output the voltages with the delays shown in Figure 3.6.
Figure 3.9: Block diagram of MM8512 [MM8512]
Figure 3.10: MM8512 Pin configuration [MM8512]
3.5 Switching and power reduction
In order to configure the Field Programmable Gate Array, the chip will be coded
in one of the two dominate hardware design languages, Verilog (the other language being
VHDL). Verilog offers the ability to configure the FPGA at the register transfer level
(RTL) which minimizes the amount of switching occurring at the gate level thus reducing
24
power consumption. According to [Anantha P. Chandrakasan, 1995], the power
consumed by a CMOS circuit is summarized by the following:
Pavg = Pswitching + Pshort-circuit + Pleakage
By reducing Pswitching less power is consumed by the circuit. Pswitching is contingent
on three different factors such as the probability (a 0->1) that the switching (from a power
consuming 0 to 1) will occur during a clock cycle with a capacitance load CL times the
clock rate fclk. The equation for Pswitching becomes the following:
Pswitching = a 0->1 CLVdd2 fclk
Minimizing the amount of switching that occurs from 0 to 1 should be avoided.
This presents a problem if the algorithm requires the output to switch frequently, such as
using NAND or NOR gates since these gates have a higher probability of switching from
0 to 1 [Anantha P. Chandrakasan, 1995]. Therefore any efforts made to minimize
number of transistor used and avoid high number of switching will ensure minimal power
is consumed. Consider the equation:
While using a hardware design language, the correct implementation of the hardware
with the intent of reducing power consumption, the circuitry must meet the following:
1. Minimize amount of transistors used
25
2. Minimize amount of switching (especially switch from 0 to 1)
There are two circuit options shown in Figure 3.11 for designing a XOR function:
using NAND and NOR gates (Figure 3.11A) versus using a multiplexer (Figure 3.11B, C
and D). Both these circuit designs accomplish the same combinatorial function however
it is evident that by using a multiplexer, the number of transistors can be reduced from 22
to 4. Therefore choosing the right circuitry with the least amount of transistors and least
amount of switching for the design is an important factor in power consumption. The
style of logic used during the design will influence the following: speed (number of
inversion levels, how many transistors are in series, the width of the channel, and wiring
capacitances both inside and outside of the cell), size of circuit (number of transistors,
their size and wiring complexity), power dissipation (switching activity and the node
capacitances), and wiring complexity (number of connections and their lengths) [Reto
Zimmermann and Wolfgang Fichtner, 1997]. Since these variables change from one
logic style to another, it is best to carefully choose the circuitry.
It is also important to consider the high power dissipation that occurs when a
dynamic logic style is used versus static. Dynamic logic offers great speed but the clock
necessary to drive the circuits during the two stages (precharge and evaluation) results in
a high amount of power dissipation [Reto Zimmermann and Wolfgang Fichtner, 1997].
Since there is a need for a clock in this design, an overall low-power design is not
possible. However, since a multiplexer will be used, the design will ultimately reduce
power consumption in comparison to using the microcontroller.
26
A: XOR Function using NAND, NOR and Inverter gates (22 transistors)
B: Mux truth table
C: Multiplexer
D: Multiplexer design (8 transistors)
Figure 3.11: Using a multiplexer versus NAND, NOR and inverter gates
27
3.6 Choosing the right chip
Quartus has several chips that choose from when implementing a design. Using a
large chip with more transistors than necessary is not only more power consuming but
space consuming as well. A chip requiring a larger core voltage will dissipate more
power. Choosing the right chip size will decrease power consumption and allow for a
smaller design.
Figure 3.12: Pin placement on two FBGA board [Quartus, Subscription Edition]
Name Chip
Logic
elementsPins
Core
VoltageCommercial Industrial
Cyclone
II
EP2C5AF256A7 4,608 158 1.2 V 0°C to
85°C
-40°C to
100°C
MAX II EPM240ZM68C6 240 54 1.8 V 0°C to
85°C
-40°C to
100°C
Table 3.1: Difference between two FPGA chips
28
The Cyclone II EP2C5AF256A7 chip is typically used and has a total of 4,608
logic elements, 158 pins and core voltage of 1.2 Volts. However, the MAX II
EPM240ZM68C6 is proposed since it has a total of 240 logic elements, 54 pins and a
core voltage of 1.8 Volts. The two chips are summarized in Table 3.1 and Figure 3.12
graphically represents the size of the chips and the placement of the pins in the FineLine
Ball-grid arrays (FBGA). The effects in power consumption that the 0.6 V difference
between the two chips has is beyond the scope of this project.
29
CHAPTER 4
THE CODE
4.1 Introduction
In order to model the algorithm from the Smart Wheelchair to a power conserving
multiplexer, behavioral modeling was used. A pseudo code was then developed to
properly understand how the algorithm functions. This code was then graphically
represented, then turned into a binary format describing how the speed and turn signal
would behave after the infrared sensors detected an obstacle. Lastly, the binary
representation was used to obtain the necessary equations to drive the multiplexer.
Following this process, the algorithm for the handheld device is modeled after the Smart
Wheelchair (SW) and developed as a more power efficient algorithm. The flow chart of
how the SW algorithm was redesigned into a Mux is shown in Figure 4.1. In this chapter,
each of these steps is discussed in further detail.
4.2 The Smart Wheelchair algorithm
The algorithm flow chart (Figure 2.2) in [Richard Simpson, PhD, et al., 2004] was
designed for the Smart Wheelchair. The algorithm includes input from the following: IR
30
sensors, sonar sensors, and the joystick. The IR and sonar sensors are used for obstacle
avoidance and the joystick outputs forward, reverse, left or right per the user�s request.
Figure 4.1: Flowchart from Smart Wheelchair (SW) algorithm to Mux
The Handheld device models the wheelchair as follows:
• Joystick => Not needed
• Wheelchair Controller => Speed and Direction Components from SHD
• Navigation Assistance Software => Verilog and A/D Converter
• IR sensor => IR sensor
o Dropoff sensor => Obstacle directly below SHD
31
• Bump and Sonar sensors => Removed from SHD
• Wheelchair Battery => SHD Battery
4.3 Pseudo code for the proposed algorithm
A pseudo code (Appendix B) was modeled after the SW algorithm. This novel
approach is superior to the SW algorithm because of lower power consumption.
Behaviors deduced from the pseudo code are as follows:
1. Handheld device defaults to try moving left first if an obstacle is detected
2. If left is not possible, try right
3. If neither left or right is possible, stop wheelchair
4. Handheld device r restricts the user�s joystick to move in direction of obstacles
5. Handheld device stops if a drop-off is detected by front IR
6. Bump switches signal rear obstacles and stops Handheld device
A graphical representation of how the handheld device functions according to this
pseudo code is shown in Figure 4.2. The device defaults to moving forward unless it
encounters an obstacle. At that time, it will first try moving left. As seen on Figure 4.2,
if a left is not possible, it will send stop signal to the left joystick. Then it will try right.
If right is not possible, it will restrict the user�s joystick in both directions and tell the
wheelchair to stop. The user would then need to back up or override the system [S. Innet,
2008]. With the handheld device, the device will first inform the user to �Stop� and try
32
moving left as seen on situation �C� in Figure 4.2. As the user swings the device left, it
will continue to test if an obstacle is in its path. As the user turns left, if there is space in
between the two obstacles (as seen on Situation �J�), the device will inform the user to
move �Forward�. With a �Stop� signal from the handheld device and a �Left� or �Right�
signal, the user essentially does a U-turn thus avoiding the obstacle. The drop off sensor
from the wheelchair is used a sensor to detect obstacles directly below the device.
4.4 Equations
In order to use the CMOS design to achieve higher reliability at lower voltages, a
multiplexer is used [Reto Zimmermann and Wolfgang Fichtner, 1997]. Once all of the
behaviors were described (as seen above), a binary representation of the algorithm is
derived. As seen in Table 1 the algorithm was translated to a binary representation of
how the wheelchair algorithm responds to inputs from the infrared sensors (complete
binary representation in Appendix A).
By using the binary representation of the proposed algorithm, example of the
equations necessary to drive the device�s outputs are derived and listed below in Table
4.1 as Equation 1, 2, and 3 for the speed, right and left signals respectively. From
Appendix A, the equation for the Speed can be visually obtained by noting that the device
should signal forward only when there is no obstacle in front or below. Note that if
Below turns to 1 (e.g. obstacle detected below device), then the speed and Left and Right
signals are set to 0 regardless of whether there is any other obstacle detected or not.
33
Figure 4.2: General situations for device
Table 4.1: Example of a pseudo code binary representation
34
Equation 1: Speed signal
Equation 2: TurnRight signal
Equation 3: TurnLeft signal
An example of a Verilog code modeled after these equations are as follows:
speed_Component <= ~temp_compF&~temp_compB; if(speed_Component == 0 && ~temp_compB) begin
TurnRight <= (~temp_compR&(temp_compL || temp_compLC || temp_compLC&temp_compL));
TurnLeft <= (temp_compR&(~temp_compLC || temp_compRC || ~temp_compL)) || (~temp_compLC&~temp_compL) ||
(~temp_compL&temp_compRC)); end else begin TurnRight <= 0; TurnLeft <= 0; End
The speed_Component is set to 0 if an obstacle is detected to the front
(temp_compF) or below (temp_compB). Then if the speed has been set to 0 due to an in
front of the device, then the Turn signals are calculated. NOTE: The gate circuitry for this
type of design can be found in Appendix E.
35
4.5 The equation using CMOS
In this section, the equations that make up the obstacle avoidance and obstacle
free path generation are proposed in two different ways: a CMOS design using the
equations and a CMOS design utilizing the multiplexer.
To design using CMOS, both P- and N-type of transistors are used to properly
output a good 1 and a good 0 respectively. DeMorgan�s law is necessary to get the
inverted equations (as seen on Equation 4, 5, and 6). The stick figure for the �Speed�
circuit is shown in Figure 4.3 where the N-type transistors are at the bottom and the P-
type transistors are at the top along with its test case in Table 4.2. The stick figures for
the TurnRight and TurnLeft signals are shown in Figure 4.4 and 4.5 along with two test
cases (A & B) for each on Table 4.3 and 4.4 respectively.
36
Equation 4: (DeMorgan�s)Speed
Equation 5: (DeMorgan�s)Turn Right
Equation 6: (DeMorgan�s)Turn Left
Figure 4.3: Speed CMOS stick figure
F 1 2 3 4 Speed 0 On On Off Off 1 0 On Off On Off 0 1 Off On Off On 0 1 Off Off On On 0 Table 4.2: Four test cases for Speed CMOS circuits
37
Figu
re 4
.4: T
urnR
ight
CM
OS
sche
mat
ic
38
Figu
re 4
.5 T
urnL
eft C
MO
S sc
hem
atic
39
40
4.6 The equations using a multiplexer
As mentioned in Chapter 3, a multiplexer is more efficient and consumes less
power than using combinatorial logic. By using the equations aforementioned and the bit
representation in Appendix A, a multiplexer can be designed as shown in Figure 4.6, 4.7,
and 4.8 for the TurnLeft, TurnRight and Speed signals. Since the speed is always 0 when
there is an obstacle in front of or below of the device and the turn signals are only
available when an obstacle is exclusively in front of the device, logic can de represented
as follows as shown in Table 4.5.
Front IR Below IR Speed Turn Signals? 0 0 1 No 0 1 0 No 1 0 0 Yes 1 1 0 No
Table 4.5: Speed MUX logic
Therefore, the multiplexer can be designed with the Front_IR and Below_IR as
the select lines (Figure 4.8) and the output from Mux1 acting as input to Mux 2. Some of
the Verilog code is shown below in Algorithm 3 (complete code in Appendix A).
case({temp_compLC, temp_compL, temp_compRC, temp_compR}) 4'b0000: {TurnLeft} = 1'b1; // MUX FOR LEFT- 4'b0001: {TurnLeft} = 1'b1; // TURN SIGNAL �endcase case({temp_compLC, temp_compL, temp_compRC, temp_compR}) 4'b0000: {TurnRight} = 1'b0; // MUX FOR RIGHT- 4'b0001: {TurnRight} = 1'b0; // TURN SIGNAL � endcase case({temp_compF, temp_compB}) 2'b00: {TurnLeft, TurnRight, speed_Component} = 3'b001; // MUX FOR SPEED 2'b01: {TurnLeft, TurnRight, speed_Component} = 3'b000; // SIGNAL �endcase
Algorithm 3: Portion of Mux 1 and Mux 2 in Verilog
41
Figure 4.6 TurnLeft Mux
Figure 4.7: TurnRight Mux
Figure 4.8: Speed Mux
The analysis, compilation and simulation reports for both designs (combinatorial
versus mux) are discussed in Chapter 6.
42
CHAPTER 5
THE SCHEMATIC
5.1 Introduction
In this chapter, how all the pieces of the lower power design come together is
discussed along with a sketch of the device itself and the results of simulation testing
using Quartus. A brief description of the unused sensors from the Smart Wheelchair is
included in order to explain why those sensors were omitted from the schematic.
5.2 Unused Sensors from Smart Wheelchair
Bump sensors used by the Smart Wheelchair disable the wheelchair from moving
in reverse. Reverse is not necessary with the SHD and it would also be dangerous
therefore this is omitted from the design. Additionally, even though sonar sensors add
obstacle avoidance sensitivity, none are used in the SHD. Lastly the Smart Wheelchair
by [Richard Simpson, PhD, et al., 2004] has the ability to use input from the user via the
wheelchair�s joystick. This function is no longer necessary since every movement by the
user will only change the direction in which the sensors are detecting an obstacle. The
option of allowing the user to choose a direction and having the device warn the user that
there is obstacle present is solved differently than the smart wheelchair. Since the
43
wheelchair is more difficult to move in a direction versus the handheld device, the user
would only need to point the device in the desired direction. The front obstacle sensor
would indicate an obstacle present accordingly.
5.3 Schematic
By combining all of the components necessary to drive this smart design as
discussed above, the schematic in Figure 5.1 is proposed. As shown, the external
components (with the exception of the IR) connect to the Verilog chip which outputs to
the Handheld device motor controls. The IR must first go through the comparator which
replaces the ADC (as discussed in Chapter 3). Figure 5.2 shows the schematic of all the
components connected. The voltage requirement for the individual components are listed
in Table 5.1 below.
Chip Description Voltage Requirement Temperature GP2D12 [Sharp] Infrared sensor 4.5 to +5.5 V Ta = 25oC
LM339 [National Semiconductor] Comparator 5 VDC 0°C to +70°C
MAX II EPM240ZM68C6 [Altera, 2008] FPGA 1.8 V 0°C ~ 85°C
MM8511-12 [Mobius Microsystems] Clock 3.0 to 3.6 V 0 to 70°C
Table 5.1: Chip voltage and temperature description
44
Figure 5.1: General design of SHD
45
Figu
re 5
.2: D
esig
n sc
hem
atic
46
5.4 The Handheld Device
Figure 5.3: Smart Handheld device
Figure 5.3 is the Smart Handheld Device. This device works similar to a
wheelchair�s obstacle detection system since it directs the user through an obstacle free
path by sending a signal to the controls. Instead of moving a wheelchair, the device
vibrates the handle on the right, left or center to indicate the user to move right, left or
stop respectively. The IR sensors are placed in a circular pattern in order to maximize the
obstacle detection capability.
IR6 is similar to the drop off from the Smart Wheelchair but instead of measuring
a drop off, it detects obstacles that are directly below the device and signals an immediate
stop, similar to the original algorithm. The algorithm for the drop-off works identical to
the SHD detecting an obstacle below it.
47
5.5 Smart Handheld Device functionalities
If the SHD is moving forward and encounters an obstacle, the device will signal
the user to sop, determine which direction has no obstacle and signals user to move in
that direction. If no direction is possible, the device continues to signal to stop and does
not trigger any directional signal.
By performing a search of available directions, the SHD will move autonomously in an
obstacle free direction (Figure 5.4 and Figure 5.5).
Figure 5.4: SHD approaching obstacle
Obstacle
Figure 5.5: SHD path to avoid font obstacle
5.6 Simulations and results
Two different simulations using Altera, Quartus II Subscription Edition Software
[Altera, Quartus II Subscription Edition Software] were performed: one with the
equations, the other using the mux (results in Figure 5.6 and 5.7 respectively). Both had
the same number of dedicated logic registers, logic elements, and total number of
48
registers. The one difference between the two is the total combinational functions were
the MUX had 11 versus 12 from the combinatorial design.
Figure 5.6: Compilation report of MUX
Figure 5.7: Compilation result of combinatorial
Both had identical outputs (Figure 5.8) and worked correctly. As shown in Figure
5.8, the device holds a stable �0� for direction and speed for the first ~50 ns of unstable
input from the infrared sensors. Then it starts with the first good input it receives from
49
the IR and turns the direction and speed outputs. Full compilation and simulation reports
for the multiplexer are found in Appendix D and PowerPlay Analyzer in Appendix F.
50
Figu
re 5
.8: W
avef
orm
for S
HD
51
CHAPTER 6
CONCLUSION AND FUTURE WORK
By using behavioral modeling, the algorithm from the smart wheelchair (Richard
Simpson, PhD, et al., 2004) can be translated to the Smart Handheld device so it can have
similar functionalities. Replacing the microcontroller with a CMOS design, a comparator
chip, and a clock can reduce power consumption. The infrared sensor delays can be
handled using nonblocking assignments using Verilog. Utilizing Quartus produced by
Altera, the Verilog code can be translated to a CMOS multiplexer ultimately minimizing
switching which reduces power consumption. Simulations via Quartus prove the design
will respond correctly to the delays and outputs from the infrared sensors. The fabricated
final product also proves the design works correctly.
Future work includes implementing the design using discrete logic instead of an
FPGA in order to minimize power consumption. More future work includes adding sonar
sensors to improve the obstacle avoidance capability. Additionally, a taller user would
need a less sensitive setting to detect an obstacle than a shorter one as seen on Figure 6.1.
Therefore, future work may consider using three different measurements from the IR.
Depending on how tall the user is a different setting would be used as displayed on Table
52
6.1. Therefore, choosing different IR sensors can also increase the usability of the
device.
Description Voltage Setting Distance measured Very Sensitive 1.4 V 1 ~18 cm Sensitive 1.0 V 2 ~30 cm Less sensitive 0.6 V 3 ~50 cm
Table 6.1: Voltage outputs from IR GP2D12
In order to compensate for the extra infrared sensor analog outputs, more
comparator chips can be used. The design for using three settings would require five
comparators as seen on Figure 6.2 below. No additional logic is required since a
mechanical switch can be used to choose between the settings.
Figure 6.1: Distance measurement of one GP2D12 IR with 3 settings
53
Figure 6.2: Future work with five comparators
Figure 6.3: Future work with potentiometer
54
Another approach to choosing the different settings and one that would add more
sensitivity to the device is using a potentiometer. Once connected to the comparator chip,
a simple turn of the potentiometer would increase or decrease the voltage which the
comparator chip would compare to the output from the IR hence changing the sensitivity
of the device (design shown in Figure 6.3). Choosing the correct pot to not exceed the
power rating of the device and to maximize the life of the pot is necessary [Elliot Sound
Products].
Additional future work may include considering that the IR used in this device
(GP2D12) can detect obstacles a maximum of 80 cm. Using different IR sensors that can
detect obstacles significantly farther should be explored. Adding a window comparator
to the drop-off infrared sensor can detect a drop off directly in front of the user. The user
can use a potentiometer to set the distance between the device and the floor. If the IR
detects an obstacle above a threshold, then alert the user to stop. If the IR detects a drop-
off (i.e. the IR output goes beyond a different threshold) then alert the user of a drop-off
by pulsating the �Speed� output.
55
APPENDIX A Binary Representation of Pseudo Code
Table A.1: Pseudo code translated into binary representation
56
APPENDIX B Smart Wheelchair�s algorithm translated to pseudo code
///////////////////Sensors///////////////////// Right_Obstacle,Left_Obstacle, Front_Obstacle, Front_Right_Corner, Front_Left_Corner, IR_DropOff; ///////////////////JoyStick Input from User////// UserJoystick; ///////////////////Indexes/////////////////////// Tried_Right = 0; Tried_Left = 0; //////////////Signal Sent to JoyStick////////////// direction_Component; speed_Component; ///////////////// USER'S INPUT///////////////////////////////// UserJoyStick; //000 = forward, 001 = reverse, 010 = left, 011 = right, 100 = stop // For speed_Component and direction_Component// // Speed: 0 = stop, 1 = forward, // Direction: 00 = right, 01 = left, 10 = stop right, 11 = stop left //////////////////////////////////////////////////////////////////////////// begin // Sensors read are: user_Joystick, and all Obstacle sensors read sensors if(userJoyStick == 00 && (Front_Obstacle || Right_obstacle || Left_Obstacle || Front_Right_Corner || Front_Left_Corner)) { if(Tried_left) { Tried_Left = false; if(Tried_Right == true) { speed_Component = 0; Tried_Right = false; } else { direction_Component = 0; // Turn Right speed_Component = 1; // Move forward Tried_Right = true; } } else { direction_Component = 01; // Turn left speed_Component = 1; // Move forward Tried_Left = true; } }
57
if (userJoyStick == 00 && Front_Right_Corner) { if (!Front_Left_Corner && !Left_Obstacle) { //left turn possible direction_Component = 01; // Turn left speed_Component = 1; } else if (Right_Obstacle) direction_Component = 10; // Stop right else speed_Component = 0; // Stop moving forward } if (userJoyStick == 00 && Front_Left_Corner) { if(!Front_Right_Corner && !Right_Obstacle) { // right turn possible direction_Component = 00; // Turn right speed_Component = 1; } else if (Left_Obstacle) direction_Component = 11; else speed_Component = 0; // Stop forward } // DROP OFF if (IR_DropOff) speed_Component = 0; // REVERSE is not necessary //if(userJoyStick == 01 && RearObject) // JoyStick_Reverse = false; // TURN RIGHT if(userJoyStick == 11 || direction_Component == 00 && (Right_Obstacle || Front_right_corner)) direction_Component = 10; // Stop right // TURN LEFT if (userJoyStick == 10 || direction_Component = 01 && (Left_Obstacle ||
Front_Left_Corner)) direction_Component = 11; // Stop left SendSingals
58
APPENDIX C Verilog Code for the SHD
/////////////////////////////////////////////////////////////////////////////////////////////////// // Ernesto Cividanes // // Device.v // // February 24, 2010 // // DESCRIPTION: After waiting for stable inputs from infrared // // sensors, if a front obstacle is detected, signal user to stop. // // Then signal user the best direction to move. // //////////////////////////////////////////////////////////////////////////////////////////////////// module HandHeldDevice ( input wire clk, compR, compL, compF, compRC, compLC, compB, output reg speed_Component, TurnRight, TurnLeft ); reg [1:0] state; reg [1:0] count; reg temp_compR, temp_compL, temp_compF, temp_compRC, temp_compLC, temp_compB; parameter S0 = 2'b00, S1 =2'b01, S2 = 2'b10; // STATES parameter SEC40NS = 2'b11, SEC1 = 2'b10, SEC2 = 2'b01; // TIME BETWEEN STATES /////////////////////////////////////////////////////////////////// always @(posedge clk) begin case(state) // WAIT FOR STABLE OUTPUT FROM INFRARED SENSORS S0: if(count < SEC40NS) begin state <= S0; count <= count + 1'b1; end else begin state <= S1; count <= 0; end // READ OUTPUTS FROM COMPARATORS S1: if (count < SEC1) begin state <= S1; count <= count + 1'b1; end else begin state <= S2;
59
count <= 0; end // SEND OUT OUTPUTS S2: if (count < SEC2) begin state <= S2; count <= count + 1'b1; end else begin state <= S1; count <= 0; end endcase /////////////////////////////////////////////////////////////////// case(state) S0: begin speed_Component <= 0; // DO NOT MOVE AS DEVICE STARTS TurnRight <= 0; // DO NOT TURN AS DEVICE STARTS TurnLeft <= 0; // DO NOT TURN AS DEVICE STARTS end S1: begin // ASSIGN COMPARATOR OUTPUTS TO TEMPORARY REGISTERS temp_compR <= compR; temp_compL <= compL; temp_compF <= compF; temp_compRC <= compRC; temp_compLC <= compLC; temp_compB <= compB; end S2: begin // MUX FOR LEFT TURN SIGNAL case({temp_compLC, temp_compL, temp_compRC, temp_compR}) 4'b0000: {TurnLeft} = 1'b1;4'b0001: {TurnLeft} = 1'b1; 4'b0010: {TurnLeft} = 1'b1;4'b0011: {TurnLeft} = 1'b1; 4'b0100: {TurnLeft} = 1'b0;4'b0101: {TurnLeft} = 1'b1; 4'b0110: {TurnLeft} = 1'b0;4'b0111: {TurnLeft} = 1'b1; 4'b1000: {TurnLeft} = 1'b0;4'b1001: {TurnLeft} = 1'b1; 4'b1010: {TurnLeft} = 1'b0;4'b1011: {TurnLeft} = 1'b1; 4'b1100: {TurnLeft} = 1'b0;4'b1101: {TurnLeft} = 1'b0; 4'b1110: {TurnLeft} = 1'b0;4'b1111: {TurnLeft} = 1'b1; endcase // MUX FOR RIGHT TURN SIGNAL case({temp_compLC, temp_compL, temp_compRC, temp_compR}) 4'b0000: {TurnRight} = 1'b0; 4'b0001: {TurnRight} = 1'b0; 4'b0010: {TurnRight} = 1'b0; 4'b0011: {TurnRight} = 1'b0; 4'b0100: {TurnRight} = 1'b1; 4'b0101: {TurnRight} = 1'b0; 4'b0110: {TurnRight} = 1'b1; 4'b0111: {TurnRight} = 1'b0;
60
4'b1000: {TurnRight} = 1'b1; 4'b1001: {TurnRight} = 1'b0; 4'b1010: {TurnRight} = 1'b1; 4'b1011: {TurnRight} = 1'b0; 4'b1100: {TurnRight} = 1'b1; 4'b1101: {TurnRight} = 1'b1; 4'b1110: {TurnRight} = 1'b1; 4'b1111: {TurnRight} = 1'b0; endcase // MUX FOR SPEED COMPONENT AND TURN SIGNAL case({temp_compF, temp_compB}) 2'b00: {TurnLeft, TurnRight, speed_Component} = 3'b001; 2'b01: {TurnLeft, TurnRight, speed_Component} = 3'b000; 2'b10: {speed_Component} = 1'b0; 2'b11: {TurnLeft, TurnRight, speed_Component} = 3'b000;
endcase end default begin speed_Component = 1'b0; TurnRight = 1'b0; TurnLeft = 1'b0; end endcase end endmodule
61
APPENDIX D Full Compilation and Simulation Reports
�FULL COMPILATION SUCCESSFUL WITH 3 WARNINGS�
Figure D.1: Compilation results for SHD
Figure D.2: Compilation warnings for SHD
62
�SIMULATOR WAS SUCCESSFUL�
Figure D.3: Simulation successful window for SHD
63
APPENDIX E Gate circuitry for Turn and Speed signal
Figure E.1: Gate circuitry for Turn and Speed signal
64
APPENDIX F PowerPlay Analyzer Summary
Figure F.1: PowerPlay Analyzer Summary for Mux
65
REFERENCES
• [AbleData, 2005] AbleData
http://www.abledata.com/abledata.cfm?pageid=19327&top=15541&ksectionid=1932
7&productid=158640&trail=0&discontinued=0
• [Altera] Altera, Extended Temperature Support for Cyclone II, Cyclone III, and MAX
II Devices, http://www.altera.com/literature/tb/tb-088.pdf, 2008
• [Agarwal, et al., 2003] A S Pandya, Ankur Agarwal and P K Kim, �Low Power
design of a Neuroprocessor�, Knowledge-Based intelligent Information and
Engineering Systems, Eds. V. Palade, R.J. Howlett and L. Jain, Springer, Berlin, Vol.
2 No. 1 pp. 856-862, 2003
• [Agarwal, et al., 2004] A. S. Pandya, Ankur Agarwal and G. Y. Chae, �Low Power
Design of the Neuroprocessor�, International Journal of Fuzzy Logic and Intelligent
Systems, Vol.4, No.1, 2004
• [Agarwal, et al., 2005] Ankur Agarwal, A. S. Pandya, YoungUhg Lho, �A Novel
Low Power Design of an ALU Using AdHoc Techniques�, International Journal of
Fuzzy Logic and Intelligent Systems, Vol.5, No.2, pp. 102-117, 2005
• [Agarwal, et al., 2006] Ankur Agarwal, A. S. Pandya, YoungUhg Lho, �Low Power
High Frequency Design for Data Transfer for a RISC and CISC Architecture�, The
International Journal of the KMICS, Vol.10, No.2, pp. 321-327, 2006
66
• [B Barshan, 2007] B Barshan, Tayfun Aytaç, Çarõ Yüzbaşõolu �Target differentiation
with simple infrared sensors using statistical pattern recognition techniques� Pattern
Recognition, Vol. 40, No. 10, pp. 2607-2620, 2007
• [Balcell, Gonzales, 1998] Balcells AC, Gonzalez JA. TetraNauta, �A wheelchair
controller for users with very severe mobility restrictions�. 3rd Annual TIDE
Congress; 1998
• [Bauman, 2010] Christian Baumann, �Field Programmable Gate Array (FPGA)�,
Summary paper for the seminar �Embedded System Architecture�, 2010
• [Cesar, 2009] Cesar Benavente-Peces, �Global System for Location and Guidance of
Disabled People: Indoor and Outdoor Technologies Integration�, Fifth International
Conference on Networking and Services, pp. 370-375, 2009
• [Chandrakasan, Brodersen, 1995] Anantha P. Chandrakasan, Robert W. Brodersen,
�Minimizing Power Consumption in CMOS Circuits�, Proceedings of the IEEE, Vol.
83, No. 4, pp. 498�523, 1995
• [Cho, 1994] Texas Instruments, Song Song Cho, �EMI Prevention in Clock-
Distribution Circuits�, 1994
• [CMU, 2009] �The Smart Cane�, CMU Media Channel
http://www.news.cmich.edu/2009/07/smart-cane-gives-a-new-directi/
• [Cho, 1994] Texas Instruments Incorporated Japan, Song Song Cho, �EMI Prevention
in Clock-Distribution Circuits�, 1994
• [Cummings, 1999] Clifford E. Cummings, �Correct Methods For Adding Delays To
Verilog Behavioral Models�, HDLCON, Rev 1.1, 1999
67
• [Elliot Sound Products] Elliot Sound Products, �Beginner�s guide to Potentiometers�
http://sound.westhost.com/pots.htm#pwr+volt
• [Freescale Semiconductor, 2010] Freescale Semiconductor, �Beyond Bits, Analog to
Digital Converter Accuracy�
http://www.freescale.com/webapp/sps/site/overview.jsp?code=784_LPBB_BLOODP
RESS
• [Gizmodo, 2007] Gizmodo, 2007 �Mygo Cane Guides the Blind, Turns Them Into
Potential Super Heroe�
http://www.gizmodo.com.au/2007/09/mygo_cane_guides_the_blind_tur/
• [Gribble WS et al., 1998] Gribble WS, Browning RL, Hewett M, Remolina E,
Kuipers BJ, �Integrating vision and spatial reasoning for assistive navigation. In:
Assistive technology and artificial intelligence�, Vol. 1458, pp. 179-193, 1998.
• [J. R. Fisher & Carla Beaudet, 2005] J. R. Fisher & Carla Beaudet, �Functional
Description of PIC16F877A Functions and Interfaces to GBT RFI Monitor Station
Electronics Division Technical Note No. 208�, National Radio Astronomy
Observatory, Electronics Division Technical Notes, 2005
• [LM339] National Semiconductor,
http://www.national.com/mpf/LM/LM339.html#Overview
• [MM8512] MM8512, Mobius Microsystems,
http://www.mobiusmicro.com/products/datasheets/MM8512-P56.pdf
• [Nunes, 2002] Pires G, Nunes U, �A wheelchair Steered Through Voice Commands
and Assisted by a Reactive Fuzzy-logic Controller� Journal of Intelligent and Robotic
Systems, Vol. 34, No. 3, pp 301-314, 2002.
68
• [PIC Data Sheet] Microchip Technology Inc., PIC16F87X Data Sheet, 28/40-Pin 8-
Bit CMOS FLASH Microcontrollers, 2001
• [Quartus, Subscription Edition] Altera, Quartus II Subscription Edition Software
http://www.altera.com/products/software/quartus-ii/subscription-edition/qts-se-
index.html
• [Reto, Wolfgang, 1997] Reto Zimmermann, Wolfgang Fichtner, �Low-Power Logic
Styles: CMOS Versus Pass-Transistor Logic�, IEEE Journal of Solid State Circuits,
Vol. 32, No. 7, pp. 1079 � 1090, 1997
• [Richard Simpson, PhD, et al., 2004] Richard Simpson, PhD, ATP; Edmund LoPresti,
PhD; Steve Hayashi, PhD; Illah Nourbakhsh, PhD; David Miller, PhD, �The Smart
Wheelchair Component System, Journal of Rehabilitation Research &
Development,� Journal of Rehabilitation Research & Development, Vol. 41, No. 3B,
pp. 429-442, 2004
• [Sharp] Sharp GP2D12/GP2D15 Specifications
http://www.acroname.com/robotics/parts/SharpGP2D12-15.pdf
• [Sharp IR Rangers Information, 2008] Sharp IR Rangers Information, 2008
http://www.acroname.com/robotics/info/articles/sharp/sharp.html#
• [S. Innet, 2008] Innet, S., Ritnoom, N, �An application of infrared sensors for
electronic white stick�, Intelligent Signal Processing and Communications Systems,
International Symposium. pp. 1-4, 2008
• [Texas Instruments] Texas Instruments, �A DSP Architecture for Power-Efficient
Performance�, A Presentation sponsored by Texas Instruments and
Microcontroller.com
69
• [The Coolest Gadgets, 2007] The Coolest Gadgets
http://www.coolest-gadgets.com/20070925/mygo-cane-could-replace-seeing-eye-
dogs/#more-8572
• [Ugo Biader Ceipidor et al., 2007] Ugo and D'Atri, Biader Ceipidor, Edoardo and
Medaglia, Carlo Maria and Serbanati, Alexandru and Azzalin, Graziano and Rizzo,
Francesco and Sironi, Marco and Contenti, Mariangela and D'Atri, Alessandro, �A
RFID System to Help Visually Impaired People in Mobility�, Conference or
Workshop Item (Paper), EU RFID Forum, pp. 13-14, 2007
• [Yoder JD, et al., 1996] Yoder JD, Baumgartner ET, Skaar SB, �Initial results in the
development of a guidance system for a powered wheelchair�. EEE Trans. Rehabil.
Eng. Sep; Vol. 4, No. 3, pp. 143-51, 1996
• [Zhiheng Li et al., 2009] Zhiheng Li, Li Li, Yi Zhang, �Future Research in Vehicle
Vision Systems�, Vol. 24, No. 6, pp. 62-65, 2009
• [Zimmerman, Wolfgang, 1997] Reto Zimmermann and Wolfgang Fichtner, �Low-
Power Logic Styles: CMOS Versus Pass-Transistor Logic, Solid-State Circuits�,
IEEE Journal Vol. 32, No. 7, pp. 1079 - 1090, 1997