Date post: | 08-Apr-2018 |
Category: |
Documents |
Upload: | varun-patel |
View: | 216 times |
Download: | 0 times |
of 54
8/7/2019 finaldtmf
1/54
Mobile Robot Controlled by a Phone
Amit K SinghSudip Pathak
Advisor: Dr. Tarek M. SobhTechnical Advisors: Professor S. Grodzinsky, Professor L. Hmurcik
Computer Science and EngineeringUniversity of Bridgeport
8/7/2019 finaldtmf
2/54
1
Table of Contents:
1. Abstract ------------------------------------------------------- 22. Objective ------------------------------------------------------- 3
3. Introduction and Background Search ----------------------------- 3
4. Design Ideas -------------------------------------------------------- 7
a) Build a robot with a phone chip --------------------------- 7
b) Using the Internet telephony server --------------------- 8
c) A combination of the Phone and the Internet -------- 9
5. Methodology and Justification ---------------------------------- 12
6. Hardware/software and test equipment required ------------- 12
7. Implementation -------------------------------------------------------- 13A) Ring Detect and Phone Line Connection ------------- 15
i) Relay Switch -------------------------------------------- 16
B) DTMF Decoder --------------------------------------------- 18
C) FPGA Control --------------------------------------------- 20
i) Clock Division Module ---------------------------------- 21
ii) Ring Detect Module ---------------------------------- 23
iii) Robot Control Module ---------------------------------- 25
iv) Motor Control module ---------------------------------- 32
D) Assembling various parts and combining thedifferent modules --------------------------------------------- 35
8. Economic Analysis ---------------------------------------------------- 35
9. Safety Concern ------------------------------------------------------- 36
10. Conclusions and Future Directions ------------------------------ - 37
11. Appendices
A) VHDL Source Code for Clock Division Module ----------- 39
B) VHDL Source Code for Ring Detect Module ----------- 42
C) VHDL Source Code for Robot Control Module ----------- 43
D) VHDL Source Code for MotorControl Module ----------- 49
E) Combine all the VHDL modules -------------------------------- 51
12. Bibliography ------------------------------------------------------- 52
8/7/2019 finaldtmf
3/54
2
Abstract:
Mobile Robots have numerous applications: unmanned exploration, land mine removal,
energy plants and manufacturing factories. Robotics as a field has a long history since 1801
when Joseph Jacquard invented a textile machine, which operated by punch cards. Today
over 100,000 robots are in use in the United States, compared with millions of computers and
cell phones. Robotics, as an area, has undergone a significant change in the last two
decades. Dramatic improvements in optimization, profound changes in costs and vast
increases in applications have made it possible for us to consider a design of a personal
robot.
We introduce a cost-effective robot that may be used in our everyday life. The idea is simple
and has been the focus of many researchers, namely using a remote controller to request a
robot to perform a specific job just as a remote controller is used for a TV to change
channels. Our focus is on reducing the costs and making the robot controllable by a device
that almost every person in the United States owns a phone. With the introduction of video
cell phones it will be possible for the user to see the robotic movement in real-time. Examples
include calling the robot on the way home from work and have it do various jobs like
vacuum the room and sprinkle the garden. This could also be done by logging on to the web
server via an internet connected device and sending signals to the robot, or directly sending
specific commands to the robot through cellular phones to a wireless server at home (with or
without a web connection).
8/7/2019 finaldtmf
4/54
3
Objective:
The objective of this project is to introduce an idea of controlling a personal robot via phone line
for practical applications in our daily life. This project is divided into two sections:
i) Conduct research on various applications of robotic systems and their feasibility.
ii) Focusing on the design and actual implementation of a control mechanism of the
robot over the existing phone lines, more precisely analog copper wires.
Introduction and Background Search:
A robot is a re-programmable multifunctional manipulator designed to move material, parts, tools,
or specialized devices through variable programmed motions for the performance of a variety of
tasks1.
Today, with the dawn of the new millennium, we are perusing a new technology. It would have
been hard to imagine how microprocessor-based computers could evolve in the 20 th century. It
may be the same with the personal robots, the only difference being that we can imagine and
visualize robots working in our homes for us. We consider personal robots to be at the same
stage that personal computers were in the 1970s. However, with the advancement in computer
technology, it might take only 10 to15 more years for the personal robots to be ubiquitous.
In the early days, robots were built to replace human workers, especially, in the automotive
industry. The first industrial robot saw service in 1962 in a car factory run by General Motors in
Trenton, New Jersey. The robot lifted hot pieces of metal from a die-casting machine and stacked
them. The idea that robots would be universal machines, capable of rapid reprogramming for a
1 The definition developed by the Robot Institute of America (RIA), a group within Society of
Manufacturing Engineers (SME)
8/7/2019 finaldtmf
5/54
4
wide variety of tasks, motivated the development of the PUMA (Programmable Universal Machine
for Assembly) by Unimation in 1978.
In practice, early robots were hard to reprogram and failed to compete with humans. Spraying
and welding were some of the few applications carried out by robots. SCARA (Selectively
Compliant Articulated Robot Arm) robots developed were for the assembly tasks in Japan, i.e. for
mounting components on printed circuit boards for the electronics industry.
The ideas about robots were then limited to consider those tasks that a human could not perform.
These include:
1) Working in hazardous environments, for example land mines, offshore oil or nuclear
industry.
2) Working in a place inaccessible to humans, for example outer space or on the seabed.
3) Work on larger scale that humans find difficult, for example a large assembly plant or
handling tasks, and to manipulate objects at the microscopic scale.
The early robots were more expensive and developing them required the expenditure of millions
of dollars in research. For example, Manny2, an anthropomorphic manikin developed at Battelle's
Pacific Northwest Laboratories in Richand, Washington, took 12 researchers 3 years and $2
million to build.
2 Manny has 42 degrees of freedom and was delivered to the US Army's Dugway Proving Ground in Utah in 1989.
8/7/2019 finaldtmf
6/54
5
Why are we considering this project?
In the last 30 years we have seen technology and technology application grow dramatically. With
the introduction of personal computers in 1970s and wireless communications around the same
time, technology has advanced from the industrial age to the information age. Dramatic
improvements in optimization, profound changes in costs and vast increases in applications have
made it possible for us to consider the design of a personal robot. In fact some personal robots
are already out in the market for limited applications.
Sony Corporation has introduced Aibo, the intelligent pet. On May 12, 1999, Designed for home
or office, a new smart and affordable personal robot was launched by Probotics, Inc. called Cye,
The compact personal robot can do a wide variety of tasks such as carry dishes, deliver mail,
lead guests to a conference room and vacuum the carpet. Using wireless communications
technology, Cye is controlled by Map-N-Zap, a highly intuitive graphical user interface (GUI)
loaded on any PC with a 133 MHz Chip or higher.
Figure 1:
Cye in Living RoomPhotograph by: Neoforma Design
Figure 2:
"Orange Cye-sr with Cordless Vac"Photograph by: Neoforma Design
8/7/2019 finaldtmf
7/54
6
A prototype robot named R100 developed at NEC's Central Research Laboratories is capable of
visual recognition, voice recognition, mechatronics and Internet communication technologies, the
robot can recognize individual faces, understand verbal commands, and move smoothly around
the home, avoiding such obstacles as tables and chairs (NEC).
Computers may be indispensable today, but they are not that friendly for many of us. NEC is
conducting research on a personal robot to break through the barrier between people and
computers. Their aim is to develop a robot companion who will become like a family member -
dependable, kind, considerate but at times maybe a little cranky and just human like the rest of
us (NEC).
From our background search we conclude that controlling a robot over the existing telephone
lines has not yet been implemented. To implement a control mechanism for controlling any robot
over a telephone line appears challenging. Hence the idea of controlling a mobile robot via phone
sounds fascinating to pursue for our senior year project.
Figure 3:R100 personal robot designed by NEC. Thisrobot communicates by talking, listening,responding and acting which is different from
the ones that communicate via keyboard, dialand buttons.
8/7/2019 finaldtmf
8/54
7
Design Ideas:
Based on our research, we came up with these three different methods to implement our idea of
controlling a robot over the phone.
a. Build a robot with a phone chip.
b. Using the Internet Telephony Server.
c. A combination of the Phone and Internet for robot control
a) Build a robot with a phone chip
One way to communicate with the robot could be to build a robot with a phone chip (similar to
Lucent Technologies phone on a chip). Various types of phones exist in the market. Initially, we
thought of using the Personal Communications Services (PCS). The radio spectrum in the 1.8 -
2GHz range is typically used for this mode of digital cellular transmission that competes with
analog and digital services in the 800Mhz and 900MHz bands. There are several advantages of
using digital transmission. A digital signal can pass through an arbitrary number of regenerators
with no loss in signal and thus travel long distances with no information loss. Voice, data, music
and images can be interspersed to make efficient use of circuits and equipment. Much higher
data rates are possible using existing lines. Compared to analog transmission, it is much cheaper
than analog transmission as we only need to distinguish between 0 and 1.
An example of this system is calling the robot on the way home and requesting the robot to
vacuum the room or take a coke can out of the refrigerator.
8/7/2019 finaldtmf
9/54
8
b)Using the Internet Telephony Server
Another approach to the same design problem could be through using the Internet to
communicate with the robot using the same PCS wireless technique. An Internet telephony
server links phone lines to the Internet. With the Internet, we can connect to the web server using
ASP or CGI programs. The web server then generates the easily decodable touch-tone. Then the
same techniques would be used on the receiving end of the robot as described earlier. One of the
added features of using the internet and the telephony server would be the ability to display a
simulation of the robotic movements at the remote location or a real time video feedback system
can be implemented.
Figure 4: An application of Robot with a phonechip
8/7/2019 finaldtmf
10/54
9
Figure 5: Example of using Internet Telephony Server
c) A combination of the Phone and Internet for robot control
A third possibility for personal robot control is to merge both of the above mentioned approaches
and use both direct dialing system and access through the Internet. Figure 6 shows the flexibility
of using an alternate system when the other system is unavailable or more expensive. For
example, if we are in some third world country and need to access the robot in our apartment in
California, then using the internet will be more economic than using a phone system. Similarly,
when we are driving on I-95 and need to access the robot to clean up our apartment before we
get back, then using a phone will definitely be the only option.
8/7/2019 finaldtmf
11/54
10
Figure 6:
Flowchart showing the combination of the two design methods:
Call receiving unit
FPGA chip with decoderand kinematics logic
Robotmotors/sensors
Telephone unit placing acall directly to the Robot
Internet controlled telephonyserver used to communicate withthe receiving unit
8/7/2019 finaldtmf
12/54
11
Another application Personal Robots may be used for is grocery shopping. The existing online
grocery shopping do home delivery at certain times. Optimistically, we can do grocery shopping
online and at the same time we can request our Phonebot to open the door, carry the delivery
and put it in the refrigerator. We know that the experiments with the robot in the field of surgery
are already being done, where a doctor can remotely monitor a patient and operate on him/her.
This idea can be further implemented by designing robots for the ambulances. This helps the
doctors to provide immediate care to the critical patients.
Figure 7: Combining the two design methods
8/7/2019 finaldtmf
13/54
12
Methodology and Justification:
Considering the fast paced modern technology the new generation of engineers need to look a
step ahead. From the beginning of this project we focused primarily on communication with a
robot. Our main objective was, and is, to make the robots more user friendly and be able to
communicate with them as we can communicate with other people around the globe. Thus we
decided to design a simple prototype of a robot that can be controlled via phone - Phonebot. To
keep it simple, we will start with a design similar to the one described under design idea (a).
Hardware/Software and Test Equipment Required
Hardware Requirements:
Flex 10K70 ChipsetTalrik II Robot (including the Servo motors and Sensors)TelePhone SetTeltone's M-8870-01 ChipSPST 90-2323, 5V relay switch from RadioShack3.58MHz Crystal Oscillators (Part # )Variable Power SupplyResistors, Capacitors and Diodes
Software Requirements:
Altera's MaxPlus IIOrCADHTMLCGI/ASPJavaMatlab
Test Equipment:
OscilloscopeLogic AnalyzerMultimetersNerd-Kit
8/7/2019 finaldtmf
14/54
13
Implementation
As mentioned above, our primary objective is to communicate and control the Phonebot over the
analog phone system. First a call is placed to the Phonebot using either Plain Old Telephony
System (POTS) or a Personal Communication System (PCS), or by using the telephony server
via Internet. Once the Phonebot receives the ring, a ring detector circuit detects it and the call is
complete by establishing a connection between the phone chip and the FPGA chip.
The project was implemented using a top-down process. We started by defining various modules.
Initially we broke down the project into two parts sending a signal through the phone line and
robot control with the FPGA device. However, during the implementation we found out that
receiving and decoding signal coming through the phone line required a lot of work. This part was
further broken down into two modules and we divided the work as shown (the description of each
module follows the basic block diagram of Phonebot and VHDL programming section is described
separately under FPGA control):
A) Ring Detect and connect phone line Sudip Pathak
B) DTMF decoder Amit Singh
The robot control part also required a new module for the controlling the motors. Hence this part
was renamed as FPGA control and divided into two parts and the lead person on each part is as
follows:
C) FPGA Control
i) Clock Division (VHDL program)- Amit Singh
ii) Ring Detect (VHDL program) Sudip Pathak
iii) Motor Control (VHDL program) Sudip Pathak
iv) Robot Control (VHDL program) Amit Singh
8/7/2019 finaldtmf
15/54
14
In the end we worked together to:
D) Assembling various parts of Phonebot and combining the different VHDL modules.
However, we had to consult more often and work very closely in order to synchronize the different
modules.
Figure 8: PHONEBOT Basic Block Diagram
PHONEBOT
PHONE ROBOT
RingDetect
And LineConnect
DTMFDecoder
+
Phone
line
FPGA (FLEX 10K20/10K70)
Robot
Control
Motor /
SensorControl
8/7/2019 finaldtmf
16/54
15
A)Ring Detect and Phone Line Connection
When the phone rings, the telephone company is sending a ringing signal, which is an AC
waveform. The common frequency used in the United States is 20 HZ and in Europe is typically
25 Hz and it can be any frequency between 15 and 68 Hz. Most of the world uses frequencies
between 20 and 40 Hz. The voltage at the subscribers end depends upon loop length and
number of ringers attached to the line; it could be between 40 and 150 Volts. There are various
types of ring detectors available in the market. We found the following circuit for the ring detector
very easy and inexpensive to design. It is very important that we connect the diodes the right
way.
C1 .1 ufCR1,CR2,CR3 1N914
C2 10 uFR1,R3 100KR2 10K
Figure 9: Phone detect circuit3
3Ring detect circuit obtained from the website,
http://www.ee.washington.edu/circuit_archive/circuits/F_ASCII_Schem_Tel.html
8/7/2019 finaldtmf
17/54
16
The telephone line mostly has only DC (-48V) and/or small signal AC (audio). In the circuit shown
in Figure 9, capacitor C1 blocks the DC and the voltage divider circuit obtained from R3 and R2
resistors prevent the low level AC from having any effect on the circuit. Now when the telephone
rings, it brings about 90V RMS of AC at 20Hz. When the telephone rings, the capacitor C2 is
charged. Diodes CR1 and CR2 guarantee that the output (ring detect logic) does not exceed the
power supply levels and prevent any damages to other circuits driven from its output. Since C2
and R1 have the time constants of 1s, the output goes low for 1second after the ring stops. This
pulse is to be detected and used for connecting the telephone circuit by the FPGA chip.
The circuit worked exactly as expected and we had no major problem wiring the circuit and
testing it. Unfortunately, while debugging the circuit at a later stage we almost damaged the
bread-board by connecting the VCC and GND the opposite way. This provided enough voltage
for the diode to be reverse biased and the heat produced was sufficient to almost melt the board.
i) Relay switch for establishing phone line connection
After detecting the circuit the next step was to establish the phone line connection. First we tried
to use a BJT switch but this complicated the problem even more as the signal we needed to pass
was negative 48 DC. Instead, using an electromagnetic switch was a lot easier approach. Using
the idea of electromagnetism, an armature can be attracted by the electromagnet, a spring and a
set of electrical contacts. The circuit is depicted in Figure 10.
8/7/2019 finaldtmf
18/54
17
Figure 10: Schematic capture of the relay circuit used for the connection.
We noticed that a relay switch was listed in the OrCAD library and this made us think that it
should be available in the market. Hence we found several kinds of these in the RadioShack web-
site. We bought the SPST 90-2323, 5V relay switch from RadioShack. In Figure 10 when a
current flows around the electromagnet, a magnetic field is created around the electromagnet
resulting different polarities at the ends of the electromagnet. Thus, the electromagnet attracts the
top metal leaf to close the upper circuit. When the electromagnet is not activated, the spring pulls
the switch open. In our project, once the ring signal is detected we activate the switch by sending
0V signal from the Altera board to close the telephone path, which completes the telephone
circuit. This is equivalent to picking up the phone to establish a connection. We were originally
thinking of sending 5V from the Altera board and grounding the other end of the coil of wire.
However this did not work and we assume that it could be because not enough current was
flowing out of the Alteras output pins. Thus we switched them around and with VCC and output
pin 0V there was sufficient current flowing through the wire to charge the electromagnet in the
relay switch.
8/7/2019 finaldtmf
19/54
18
B) DTMF Decoder
Dual Tone Multi Frequency (DTMF) signals are used for speed dialing and replace the
conventional rotary dialing system. These signals correspond to the digits on the dial pad of any
modern touch-tone phones. Each of those touch-tones is constructed with the combination of two
different frequencies. This information can be utilized to find out which button was pressed on the
keypad and can be used for various applications. The construction of the signals according to
different frequencies is shown in table as:
High Frequency Values (Hz)
1209 1336 1477 1633
697 1 2 3 A
Low Frequency 770 4 5 6 B
Values (Hz) 852 7 8 9 C
941 * 0 # D
Table 1: Signals related to different frequencis
These frequencies can be decoded using precise filters and then we can decode which digit was
pressed depending upon these decoded frequencies. We used the M-8870-01 DTMF decoder
chip to decode this information. The chip uses a series of low pass and high pass filters to
decode the frequencies. Then it uses a digital detection algorithm and a code converter to provide
its output in the form of four binary output data. This data is supplied to the FPGA chip for further
use. The internal circuit used by the chip to decode the DTMF is shown in figure 11.
8/7/2019 finaldtmf
20/54
19
Figure 11: Internal circuit of the DTMF decoder (from Teltones Data Sheet).
There are various problems in decoding these DTMF signals such as Talk off, Talk down,
Substandard DTMF, etc. which can provide false DTMF signals at times. Talk off errors occur
when false signal is detected due to voice or other noise. Talk down errors occur when we miss
some of the detected signals due to line noise or outgoing/incoming voice. Substandard DTMF
are the errors in generated DTMF signals due to substandard components in the generating
device such as the telephone set or the keypad. Most of these errors can be eliminated if we use
more precise components (resistors and capacitors). While testing the DTMF decoder circuit we
observed that a slight change in the voltage, current, resistors or capacitors could trigger a
significant errors. It was realized while testing the circuit that the Teltones decoder works under
very specific ranges of voltage and current. It was very strange for us to find out that the 5V
device actually worked better with 3V. We are suspicious that this could actually be a 3.3V
device.
8/7/2019 finaldtmf
21/54
20
C) FPGA Control
For the controller we decided to use the Alteras Flex 10K70 chip. The FPGAs contain arrays of
logic cells, and enable designing real systems to operate at increasingly higher frequencies. They
have the ability to increase integration, to place more and more electronics in a chip and use all
available gates within the FPGA thereby providing cost-effective solutions. The most important
factor for selecting this chip is that we can program and reprogram the device while it is in a
system. This provides us with a great flexibility for using the Phonebot. The Phonebot can be
programmed within few minutes to do any task. Once programmed the robot will have the
intelligence to complete the requested task. The FPGA chip can also be programmed to store
the complex kinematics of the robot and send a feedback, using the DTMF generator via the
same phone line (this has not been implemented in this project). For our project, Flex 10K70 is
used to control the Phonebot based on the signals decoded by the DTMF decoder.
The FPGA chip decodes the 4-bit binary output (from the DTMF decoder) into its useful
commands for the robot. The device is programmed to decode the DTMF signals, issue
commands to the robot, and send pulses to the servo-motors based on the logic programmed into
it. The controller consists of these four modules:
8/7/2019 finaldtmf
22/54
21
Clock DivisionModule
i) Clock Division Module
This module divides the 25MHz clock of Alteras University Board into slower clocks so that we
can provide the precise timing for the servo-motors because these motors work at pulses in the
order of milliseconds. As shown in Figure 12, the 25MHz clock is divided into 1Mhz, 100Khz,
10KHz, 10Hx and 1Hz. The Robot Control module requires 10Hz clock whereas the Motor
Control module requires 10KHz clock. The VHDL source code for this module is provided in
Appendix A.
Clock_1MHz
Clock_100KHz
Clock_25MHz Clock_10KHz
Clock_10Hz
Clock_1Hz
Figure 12: Block diagram of clock division module
Figure 13: Flow chart of Clock Division module
8/7/2019 finaldtmf
23/54
22
Clock Division:Clock change within 20us:
Clock changes at 13 cycles of25MHz clock (for 1MHz clock)
Clock change within 1ms range:
Clock changes at 5 cycles of100KHz clock (for 10KHz clock)
Clock change within 20ms range:
Clock changes at 5 cycles of10KHz clock (for 1KHz clock)
Figure 14: Timing diagrams for clock division
8/7/2019 finaldtmf
24/54
23
Ring Detect Module
ii) Ring Detect Module
This module takes its input from the ring detector circuit and the DTMF decoder, provides output
to the relay for closing or opening the telephone circuit. As soon as a ring is detected this module
provides a 0V signal to the relay and thus closes the circuit. When it senses a DTMF code for
digit 0, it opens the switch again. We had a small problem while disconnecting the phone. The
FPGA device stored the code for digit 0 even after it was disconnected and for the same reason
next time we dialed up, it would connect and disconnect on its own. This problem was resolved
by resetting the signals in the FPGA device on the falling edge of the SB signal (SB signal goes
high when there is a valid code detected by the DTMF decoder).
SB
Clear
Ring_Detect Ring_Connect
D (Touch Tones)
Figure 16: Ring Detect Timing Diagram
Figure 15 : Block diagram of Ring Detect Module
8/7/2019 finaldtmf
25/54
24
Figure 17: Ring Detect Module Flow Chart
8/7/2019 finaldtmf
26/54
25
Robot ControlModule
iii)Robot Control Module
This module programes the movement of the robot according to the detected DTMF signals. It
determines the path of the robot and provides a signal for the servo motor control module
controlling the direction and the duration of running the motors. For example, if we press 7, it
moves the robot in forward direction for 4 seconds; if we press 8, the Phonebot moves in reverse
direction for 4 seconds; and if we press #, Phonebot comes to a complete stop. We also added
few bump switches to the Phonebot. These bump switches send a high signal to the FPGA when
they are bumped. Depending upon which bumper detects switch closures, the FPGA device
determines where the collision occurred and issues a signal to the Phonebot to change the
direction of its path.
Clk_10 Hz lmotor_speed
SB rmotor_speed
D lmotor_dir
Sensors (S1,S2,S3) rmotor_dir
Figure 18: Robot Control Module Block Diagram
8/7/2019 finaldtmf
27/54
26
Figure 19: Robot Control Module Flow Chart
8/7/2019 finaldtmf
28/54
27
8/7/2019 finaldtmf
29/54
28
8/7/2019 finaldtmf
30/54
29
8/7/2019 finaldtmf
31/54
30
8/7/2019 finaldtmf
32/54
31
8/7/2019 finaldtmf
33/54
32
Motor ControlModule
iv) Motor Control Module
The Phonebot has two servo motors to aid its movement. First we had to hack these motors to
create a DC gearhead motor. The information on hacking the servos was obtained from
Mekatronix manual for the Talrik II robot (). The hacked servos work on Pulse Width Modulation
(PWM). This module provides the robot with pulses at specific times. If we provide a pulse for 1 to
1.5ms, then the motor spins in one direction and if we provide a pulse for 1.5 to 2ms, then the
motor spins in another direction. The pulses have to be issued in an interval of about 20ms. This
module takes care of this pulse generation timing.
Clk_10KHzLmotor_speedRmotor_speed lmotorLmotor_dirRmotor_dir rmotor
Figure 21: Motor Control Block Diagram
8/7/2019 finaldtmf
34/54
33
Figure 22: Motor Control Flow Chart
8/7/2019 finaldtmf
35/54
34
Figure 23: Motor Control Timing Diagrams
8/7/2019 finaldtmf
36/54
35
D) Assembling various parts of Phonebot and combining the different VHDL modules
The final task in the project involved assembling the different modules together. Putting together
the physical parts was a lot more arduous task. We had to be make a common ground for the
FPGA device, the circuit we designed for the ring detection and the DTMF decoder. The Altera
was not detecting the decoded signals produced by the DTMF decoder until we made a common
ground. The main controller program was implemented in structural format combining the various
components. The VHDL source code for combining all the different modules is provided in
Appendix E.
Economic Analysis:
Overall cost for the Phonebot was very small. The following table shows the amount we had to
spend to design the Phonebot.
Part QTY Per unit
*Servo Motorsand Wheels
- - 10.00
*FPGA chip(Flex 10k70)
- - N/A
DTMF Decoder(Teltone M-8870-01)
1 1.50 1.50
Relay Switch(SPST 90-2323)
1 2.40 2.40
Oscillator 1 3.00 3.00Capacitors 5 0.60 3.00Resistors 8 ~ 0.50 4.00Diodes 3 0.50 1.50Wires/Circuit Board 1 pk 5.00 5.00
Sensors 4 2.00 8.00*Wood - - 10.009V Adapter /Ni-MH Battery
1 15.00 15.00
TOTAL COST (Estimate) $ 63.40 + FPGA Chip
Prices were quoted from RadioShacks website (http://www.radioshack.com)* Estimated price for comparison purpose only
8/7/2019 finaldtmf
37/54
36
Assuming the FPGA chip costs around $100, we can build a Phonebot for about $163.40.
Compared to CYE which costs $800.00 or Aibo which costs $2500.00, Phonebot is very cheap. If
we were to do a mass production, these figures would drop significantly.
Safety Concerns:
Phonebot does require some safety measures.
i) One should always keep in mind that there is 90V AC coming from the telephone
wire when a telephone rings. During our implementation phase we took an extra
precaution. Never touch the wires when a phone is ringing.
ii) Phonebot has a wire connecting it to the phone jack on the wall. If this were to be a
commercial product, we could either use a remote phone jack that is available in the
market.
Depending upon the task the Phonebot is programmed to carry out, more safety measures may
be required. The Phonebot does not have a cover. Putting a cover around the Phonebot would
protect anyone from tampering with the wires.
8/7/2019 finaldtmf
38/54
37
Conclusions and Future Directions:
According to a research conducted by Nortel networks, there are 750 million people in the world
who use telephones. Hence, there are 750 million people in the world who can dial to our
Phonebot and control it. Probably this is the first of its kind. The current phone number assigned
to the Phonebot is (203) 576 4156.
The idea of Phonebot evolved from our original idea of designing a wireless controlled robot. It
was during our research phase that we started considering the idea of controlling a robot via a
telephone line. We encountered various problems as described under various modules. Besides
these, we did have problems getting the right equipment at the right time. It was only after we got
24 hrs access to the EE labs that we found out we really had all the resources required to
implement a project like this. For several days we tried to build a circuit to decode the DTMF
signals from the Teltones 5V device and we were not progressing. After we got full access to the
EE labs, we had all the resources we needed including the logic analyzer, oscilloscope, power
supplies, etc.
Designing the Phonebot was an enthralling project. This project required:
An understanding of Robotics
Considerate knowledge of FPGAs and proficiency in VHDL
Exceptional knowledge of Electronics and Circuit design
Hands on experience on Assembling/Soldering parts
Fair knowledge of Telecommunications
In several instances we realized that the courses we took during our last 3 /4 years were crucial
and sufficient for us to be able to implement a project like this. This project involved an extensive
research during the first semester and a successful implementation during the 2nd semester of our
8/7/2019 finaldtmf
39/54
38
senior year. This project not only utilized our knowledge and skills but refined them to a
professional level.
Upon successfully implementing our idea of Phonebot, we have gained more confidence in our
skills learned in the last few years. However, there are several features that could be added to the
Phonebot:
- Instead of the DTMF decoder, we can use a voice encoder/decoder. Similar to a DTMF
decoder, the voice decoder would recognize certain frequencies and depending upon
those frequencies, the Phonebot can be programmed to do certain tasks. This feature
could also be used for security purpose.
- Program the Phonebot to do specific tasks like vacuum a room, take out a coke can
from the refregerator.
- Using more sensors and a visual feedback would make the Phonebot more animated
and will be able to carry out more tasks.
- Integrating with the Internet is another possibility that would add more access to the
Phonebot. This would be very suitable for grocery shopping. When a person does an
online grocery shopping, the Phonebot would know what were bought and what to expect
when a delivery person comes. Besides, Phonebot could also be programmed to keep
track of what is available in the stock.
This shows that a list for improvements on Phonebot and various application it could be used is
very long. Hence, we conclude that Phonebot has the potential to generate a new wave in the
modern technology.
This report is also available on the Computer Science and Engineering website under the
projects. A movie file is also included on the website. The current link to the website is
http://www.bridgeport.edu/cse/projects/phonebot/index.html .
Finally we thank our Professors at UB, especially Dr. T. Sobh, Professor S. Grodzinsky and
Professor L. Hmurcik for their guidance.
8/7/2019 finaldtmf
40/54
39
APPENDIX A
--***************************************************--THIS PROGRAM DIVIDES THE 25MHz CLOCK OF THE ALTERA'S **
--UNIVERSITY BOARD INTO DIFFERENT SLOWER CLOCKS TO RUN **
--OTHER MODULES WHICH REQUIRE SLOWER CLOCKS **
--*********************************************************--*********************************************************
library IEEE;use IEEE.STD_LOGIC_1164.all;use IEEE.STD_LOGIC_ARITH.all;use IEEE.STD_LOGIC_UNSIGNED.all;
ENTITY clk_div IS
PORT(
clock_25Mhz : IN STD_LOGIC;clock_1MHz : OUT STD_LOGIC;clock_100KHz : OUT STD_LOGIC;clock_10KHz : OUT STD_LOGIC;
clock_1KHz : OUT STD_LOGIC;clock_100Hz : OUT STD_LOGIC;clock_10Hz : OUT STD_LOGIC;clock_1Hz : OUT STD_LOGIC);
END clk_div;
ARCHITECTURE a OF clk_div IS
SIGNAL count_1Mhz: STD_LOGIC_VECTOR(4 DOWNTO 0);SIGNAL count_100Khz, count_10Khz,count_1Khz :STD_LOGIC_VECTOR(2 DOWNTO 0);SIGNAL count_100hz, count_10hz, count_1hz : STD_LOGIC_VECTOR(2 DOWNTO 0);SIGNAL clock_1Mhz_int, clock_100Khz_int,
clock_10Khz_int, clock_1Khz_int : STD_LOGIC;SIGNAL clock_100hz_int, clock_10Hz_int, clock_1Hz_int : STD_LOGIC;
BEGIN PROCESSBEGIN
-- This portion generates a 1MHz clock
WAIT UNTIL clock_25Mhz'EVENT and clock_25Mhz = '1';IF count_1Mhz < 24 THEN
count_1Mhz
8/7/2019 finaldtmf
41/54
40
PROCESSBEGIN
WAIT UNTIL clock_1Mhz_int'EVENT and clock_1Mhz_int = '1';IF count_100Khz /= 4 THEN
count_100Khz
8/7/2019 finaldtmf
42/54
41
IF count_1hz /= 4 THENcount_1hz
8/7/2019 finaldtmf
43/54
42
APPENDIX B--THIS PROGRAM DETECTS THE TELEPHONE RING AND
--THEN CLOSES THE SWITCH TO COMPLETE THE PHONE
--CIRCUIT. IT ALSO OPENS THE SWITCH TO DISCONNECT
--THE PHONE AT THE END
library IEEE;use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_ARITH.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
ENTITY ring_detection IS
PORT(extra_pin : IN STD_LOGIC;
--CLEAR PIN TO DISCONNECT THE PHONE IN THE BEGINNING
D : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
--TOUCH TONE DECODED FROM M-8870-01
ring_detect : IN STD_LOGIC;
--COMING FROM RING DETECT CIRCUIT
ring_connect : OUT STD_LOGIC);
END ring_detection;
ARCHITECTURE a OF ring_detection IS
BEGIN
PROCESS (ring_detect,extra_pin)
BEGIN
IF extra_pin = '0' THEN
--DISCONNECT THE PHONE IN THE BEGINNING
ring_connect
8/7/2019 finaldtmf
44/54
43
APPENDIX C
--*********************************************************
--**THIS PROGRAM DECODES THE DTMF SIGNALS INTO USEFUL **
--**COMMANDS OF ROBOTIC MOVEMENT AND ALSO DEALS WITH **
--**THE INPUTS FROM SENSORS **
--*********************************************************-- Lmotor_dir 0=forward 1=reverse-- Rmotor_dir 1=forward 0=reverse-- Lmotor_speed 1 = GO 0 = STOP-- Rmotor_speed 1 = GO 0 = STOP--DTMF SIGNALS:--6 is for return back movement--7 is for forward movement--8 is for left turn--9 is for right turn--10 is for disconnect--11 is for specific path A--All the rest are for stop--********************************************************--********************************************************library IEEE;use IEEE.STD_LOGIC_1164.all;use IEEE.STD_LOGIC_ARITH.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
ENTITY control_robot ISPORT(S1,S2,S3 : IN STD_LOGIC; --SENSORS
clock_10hz,SB : IN STD_LOGIC; --SB IS INDICATION OF NEW--TOUCH TONE DETECTION
D : IN STD_LOGIC_VECTOR(3 DOWNTO 0);--TOUCH TONE DECODED BY M-8870-01 CHIP
lmotor_speed, rmotor_speed : OUT STD_LOGIC; --STOP OR GO FOR ROBOTlmotor_dir, rmotor_dir : OUT STD_LOGIC);
--DIRECTION OF SPIN OF SERVO MOTORS
END control_robot;
ARCHITECTURE a OF control_robot IS
SIGNAL timer : STD_LOGIC_VECTOR(7 DOWNTO 0);SIGNAL D_flag : STD_LOGIC;TYPE STATE_TYPE IS (forward,forward2, turnleft,turnleft2,turnright,
turnright2,pathA,pathA2,pathA3,pathA4,return_back,return_back2,stop,rest,sensor,sense1,sense2,sense3);
SIGNAL state: STATE_TYPE;SIGNAL sensor_flag : STD_LOGIC;
BEGIN
-- State Machine to Control Robot
CONTROL_PROCESS: PROCESS (clock_10hz,SB)BEGIN
IF SB = '1' THEN --DETECTION OF A NEW TOUCH TONEstate
8/7/2019 finaldtmf
45/54
44
state
8/7/2019 finaldtmf
46/54
45
lmotor_speed
8/7/2019 finaldtmf
47/54
46
state
8/7/2019 finaldtmf
48/54
47
--ACTION FOR FRONT SENSORlmotor_speed
8/7/2019 finaldtmf
49/54
48
SENSOR_DETECT: PROCESS(S1,S2,S3)BEGIN
IF (S1 = '1' OR S2 = '1' OR S3 = '1') THEN--SENSOR DETECTS AN OBSTACLE
sensor_flag
8/7/2019 finaldtmf
50/54
49
APPENDIX D
--************************************************************
--**THIS PROGRAM PROVIDES THE PULSES FOR THE SERVO MOTORS **
--**AT SPECIFIC TIMES REQUIRED BY THE MOTORS FOR THEIR **
--**CLOCKWISE AND ANTI-CLOCKWISE MOTION. **
--************************************************************
LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_ARITH.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY motor_control ISPORT(clock_10khz : IN STD_LOGIC;
lmotor_dir, rmotor_dir : IN STD_LOGIC;--DIRECTION OF SPIN FOR MOTORS
lmotor_speed, rmotor_speed : IN STD_LOGIC;--GO OR STOP FOR MOTORS
lmotor, rmotor : OUT STD_LOGIC);--PULSES FOR THE TWO MOTORS
END motor_control;
ARCHITECTURE a OF motor_control ISSIGNAL count_motor: INTEGER RANGE 0 TO 200; --COUNTER TO COUNT UPTO 20ms
BEGINPROCESS
BEGINWAIT UNTIL clock_10Khz'EVENT AND clock_10Khz = '1';IF count_motor /=200 THEN
--RESET COUNTER AT EVERY 20ms
count_motor
8/7/2019 finaldtmf
51/54
50
--RIGHT MOTOR MOVEMENT
CASE rmotor_dir ISWHEN '1' => --FORWARD SPIN
rmotor --REVERSE SPIN
rmotor NULL;END CASE;
ELSErmotor
8/7/2019 finaldtmf
52/54
51
APPENDIX E
--*************************************************************
--*********MOBILE ROBOT CONTROLLED BY A PHONE******************
--*************************************************************
--**THIS PROGRAM COMBINES ALL THE INDIVIDUAL MODULES INTO A **
--**SINGLE MODULE TO BE DOWNLOADED ONTO THE FPGA CHIP TO **
--**CONTROL THE ROBOT.
**--*************************************************************
--*************************************************************
LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_ARITH.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY main ISPORT (clock, SB, ring_detect,extra_pin :IN STD_LOGIC;
S1,S2,S3 :IN STD_LOGIC;D :IN STD_LOGIC_VECTOR(3 DOWNTO 0);lmotor, rmotor, ring_connect :OUT STD_LOGIC);
END main;
ARCHITECTURE A OF main IS
SIGNALclock_1MHz_sig,clock_100KHz_sig,clock_10KHz_sig,clock_1KHz_sig,clock_100Hz_sig,clock_10Hz_sig,clock_1Hz_sig : STD_LOGIC;SIGNAL lmotor_speed_sig, rmotor_speed_sig : STD_LOGIC;SIGNAL lmotor_dir_sig, rmotor_dir_sig : STD_LOGIC;
COMPONENT clk_div --PROVIDES SLOWER CLOCKS FOR THE SERVOSPORT(
clock_25Mhz : IN STD_LOGIC;clock_1MHz : OUT STD_LOGIC;clock_100KHz : OUT STD_LOGIC;clock_10KHz : OUT STD_LOGIC;clock_1KHz : OUT STD_LOGIC;clock_100Hz : OUT STD_LOGIC;
clock_10Hz : OUT STD_LOGIC;clock_1Hz : OUT STD_LOGIC);
END COMPONENT;
COMPONENT ring_detection --CONNECTS THE PHONE LINE WHEN IT RINGSPORT(extra_pin : IN STD_LOGIC;
D : IN STD_LOGIC_VECTOR(3 DOWNTO 0);ring_detect : IN STD_LOGIC;ring_connec : OUT STD_LOGIC);
END COMPONENT;
COMPONENT control_robot --DETERMINES THE DIRECTION AND DURATION OFPORT(S1,S2,S3 : IN STD_LOGIC; --ROBOT'S MOVEMENT
clock_10hz, SB : IN STD_LOGIC;D : IN STD_LOGIC_VECTOR(3 DOWNTO 0);lmotor_speed, rmotor_speed : OUT STD_LOGIC;
lmotor_dir, rmotor_dir : OUT STD_LOGIC);END COMPONENT;
COMPONENT motor_control --PROVIDES PULSES FOR THE SERVO MOTORSPORT(clock_10khz : IN STD_LOGIC;
lmotor_dir, rmotor_dir : IN STD_LOGIC;lmotor_speed, rmotor_speed : IN STD_LOGIC;lmotor, rmotor : OUT STD_LOGIC);
END COMPONENT;
BEGIN
8/7/2019 finaldtmf
53/54
52
U1: clk_div
PORT MAP(clock,clock_1MHz_sig,clock_100KHz_sig,clock_10KHz_sig,clock_1KHz_sig,clock_100Hz_sig,clock_10Hz_sig,clock_1Hz_sig);
U2: ring_detectionPORT MAP(extra_pin,D,ring_detect,ring_connect);
U3: control_robotPORT MAP(S1,S2,S3,clock_10Hz_sig,SB,D,lmotor_speed_sig,
rmotor_speed_sig,lmotor_dir_sig,rmotor_dir_sig);
U4: motor_controlPORT MAP(clock_10KHz_sig,lmotor_dir_sig,rmotor_dir_sig,
lmotor_speed_sig,rmotor_speed_sig,lmotor,rmotor);
END ;
8/7/2019 finaldtmf
54/54
Bibliography:
1. Tanenbaum, Andrew S. Computer Networks, New Jersey, Prentice Hall.
2. Meyers, Robert A. Encyclopedia of Telecommunications, Academic Press Inc.
3. Skahill, Kevin. VHDL for Programmable Logic, Addition-Wesley, 1996.
4. Yalamanchili, Sudhakar. VHDL Starter's Guide, Prentice Hall, 1998.
5. Doty, Keith L. TALRIKII Assembly Manual, MekatronixTM, 1999.
6. Internet: http://www.wired.com/news/gizmos/0,1452,32930-3,00.html
7. Internet: http://ourworld.compuserve.com/homepages/Bill_Bowden/page3.htm#spr
8. Internet: http://www.phonezone.com/tutorial/index.htm
9. Internet: http://www.phm.lu/documentation/connectors/Serial.asp
10. Internet: http://www.attitude-long-distance.com/how_phones_work.htm
11. Internet: http://www.ee.washington.edu/circuit_archive/circuits/F_ASCII_Schem_Tel.html
12. Internet: http://www.howstuffworks.com/relay.htm
13. Internet: http://www.d2tech.com/dtmfbenefits.htm
14. Internet: ftp://ftp.teltone.com/pub/8870.pdf