You are on page 1of 6

IEEE TRANSACTIONS ON EDUCATION, VOL. 40, NO.

4, NOVEMBER 1997 253

A Vision-Guided Autonomous Vehicle:


An Alternative Micromouse Competition
Ning Chen

Abstract— A persistent problem facing today’s engineering pair, and a video frame grabber. The vehicle is an off-the-
educators is how to promote students’ interest in science and shelf RC toy car mounted with a miniature CCD camera and
engineering. One of the best approaches to this challenge is a 900-MHz transmitter. A receiver connected to a PC receives
to sponsor a technological competition that combines publicity,
technology, and student participation. A current leading com- the image and generates an RS-170 video signal. The video
petition called “micromouse,” although earning high marks on signal is digitized by a frame grabber built at CSUF and is
publicity and technology, has had difficulty attracting large-scale discussed in detail later. The digitized image is then processed
student participation. In this paper a vision-guided autonomous by a program written in the C language. The software performs
vehicle project developed at California State University, Fullerton pattern recognition and generates drive commands. The hand-
(CSUF) is proposed as an alternative. The idea is to fit an
ordinary radio-controlled toy car with a charge-coupled device held controller that comes with the RC car is modified so that
(CCD) camera and a transmitter. Image processing and control it can be controlled by the PC directly. The drive command is
of the car are accomplished by a personal computer (PC). The sent to the vehicle by the hand-held controller at a frequency
road image captured by the camera is transmitted to a PC via a at 27 MHz. The vehicle runs on a white floor with black
transmitter–receiver pair at 900 MHz. A frame grabber board dashed lines as tracks. Tracks can be arranged as a single loop
digitizes the image, and an image-processing program subse-
quently analyzes the road condition and generates adequate drive for racing or as multiple branches for maze solving. Student
commands that are transmitted back to the vehicle via the built- teams write programs that drive the vehicle. A large-screen
in radio controller. Student teams write programs to compete TV also receives the image in real time. The audience can
in racing or maze solving. In this paper detailed hardware and view the actual image on TV as seen by the vehicle while
software designs of the project are presented. The merit of the also commanding a birds-eye view of the competition arena
project with respect to the criteria of publicity, technology, and
student participation is also addressed. from the audience stand.
Section II analyzes the weaknesses of the micromouse
Index Terms— Autonomous vehicles, student competition, competition. The hardware of the proposed vision-guided
visopn-guided vehicles.
autonomous vehicle is presented in Section III. Section IV
covers the software responsible for pattern recognition and
I. INTRODUCTION command generation. Section V discusses the advantages of
the proposed project for promotion and recruiting purpose in
T HE micromouse competition is one of the major student
competitions that stimulates interests of students majoring
in electrical engineering, computer science, and computer
terms of publicity, technology, and student participation. The
conclusion is presented in Section VI.
engineering. Nevertheless, this competition has not been pop-
ular enough to become a significant inter-school activity. For II. CURRENT MICROMOUSE COMPETITION
example, IEEE Region Six holds a micromouse competition
annually and among the six to seven engineering schools that A. General Description
attended the meeting regularly, there is usually only one or two The current micromouse competition is conducted on a maze
schools that have managed to produce fully functional mice. as specified in Fig. 1. A typical micromouse built to maneuver
The major reason for this low success rate is not due to a the maze is shown in Fig. 2.
lack of interest, instead, it is the technical and nontechnical The first difficulty is the maze itself. The specifications
difficulties associated with the micromouse project. We at require a large wood floor of 3 m 3 m that is expensive
CSUF have tried to establish the micromouse program for and difficult to build. At CSUF we tried to build one, but
several years [1] but only have achieved modest results. after spending $1700, it still did not fully comply with the
By learning from the weaknesses of the current micromouse specifications. To utilize the maze is another problem. A
competition, we propose a vision-guided autonomous vehicle special room needs to be set aside permanently for the maze.
project as a viable alternative. Most of the testing of the micromouse requires the maze and
The project consists of the following hardware: a radio- it is virtually impossible for students to test their vehicles at
controlled (RC) toy car, a CCD camera, a transmitter–receiver home.
The construction of the micromouse also presents difficulty.
Manuscript received August 26, 1996; revised September 2, 1997. The main reason is that the maze square is very small. No off-
The author is with the Department of Computer Science and Department of
Electrical Engineering, California State University, Fullerton CA 92634 USA. the-shelf toy cars with steering mechanism can fit in the square.
Publisher Item Identifier S 0018-9359(97)08366-0. As a result, students need to build a precision mechanism that
0018–9359/97$10.00  1997 IEEE

Authorized licensed use limited to: COLLEGE OF ENGINEERING. Downloaded on May 4, 2009 at 10:52 from IEEE Xplore. Restrictions apply.
254 IEEE TRANSACTIONS ON EDUCATION, VOL. 40, NO. 4, NOVEMBER 1997

4) It is very difficult to sponsor high school micromouse


teams. The value of the competition for the purpose of
recruitment is not high.

III. THE PROPOSED VISION-GUIDED


AUTONOMOUS VEHICLE COMPETITION

A. General Description
Fig. 1. Micromouse maze specification. We propose a new competition that takes advantages of the
following.
1) The use of CCD cameras, frame grabbers, and related
products that are becoming widespread due to the ex-
plosion of the multimedia market. These products are
inexpensive and readily available.
2) The fact that many students own powerful computers
with excellent programming environment and many of
whom possess excellent programming skills.
A vision-guided autonomous vehicle consists of a CCD
camera and a transmitter mounted on an RC car while a
receiver and a frame grabber are connected to a PC. A
Fig. 2. A micromouse example. competition arena that consists of a white floor with black
dashed line serving as tracks hosts the game. The participants
is beyond the ability of most electrical engineering or computer run their software program on a PC. The program processes
science students. The cost of such a precision mechanism is the image seen by the vehicle and issues drive commands back
also very high. to the vehicle. Participants’ merit is judged by how fast the
The on-board computer typically is a single board computer vehicle finishes the loop or by how intelligently the vehicle
built from scratch using the wire-wrap prototyping technique. solves a maze. Major components of the project are discussed
Microcontrollers used include the 68HC11 and 80C188EB. in detail below:
To increase reliability and to reduce power consumption,
micromouse builders usually try to reduce the number of B. Vehicle
components used. As a result, the on-board computer is usually The vehicle used is a popular radio-controlled toy car called
barely able to handle the computation. The software program “little R/C buggy.” This toy car has a good steering mechanism
is written from scratch and stored in EPROM’s. There is no and has a changeable gear train. During testing and debugging,
floppy or hard drive and the on-board computer does not the low gear feature is very handy. With three C batteries, it
provide any programming environment making debugging an can run almost 6 h without recharging. This also makes the
extremely time-consuming process [1]. testing less painful.
The sensor system is made of eight or more reflective
infrared sensors. These discrete sensors can only take in C. Camera
limited amount of information.
We used an inexpensive black and white CCD camera with
a built-in wide angle lens costing about $130. It outputs a
B. Concerns
standard RS-170 video signal and accepts a dc input from 8
The major weakness of the micromouse competition is that to 14 V.
it is very difficult to achieve large-scale student participation
without a strong support from the faculty. Furthermore, high D. Transmitter/Receiver Pair
school students and college freshmen who show significant
interests cannot build their own micromice without having to The transmitter/receiver pair is an off-the-shelf product
take two to three years of engineering courses first. Our ex- costing about $100 per pair. It can deliver quality video signal
perience on micromouse project at CSUF gives the following at 900 MHz with a range of 125 ft. Fig. 3 shows a picture
observations. of the vehicle fitted with a CCD camera, a transmitter, and a
battery pack.
1) The maze specifications are not reasonable.
2) Professional machine-shop service is required to build
the mechanical portion of the micromouse. E. Frequency Demodulator
3) Building and programming an embedded real-time sys- The off-the-shelf receiver outputs a signal intended for TV
tem is interesting. However, it can quickly become channel 4 which needs to be demodulated back to the RS-
a nightmare if expensive in-circuit-emulator, software- 170 video signal. Instead of buying or building a frequency
developing tools and other equipment are not available. demodulator, we simply run the receiver output to a VCR. The

Authorized licensed use limited to: COLLEGE OF ENGINEERING. Downloaded on May 4, 2009 at 10:52 from IEEE Xplore. Restrictions apply.
CHEN: A VISION-GUIDED AUTONOMOUS VEHICLE 255

Fig. 5. A competition arrangement.

Fig. 3. A radio-controlled toy car fitted with CCD camera, transmitter, and
battery pack.

Fig. 6. An actual track image seen by the vehicle.

track or a maze. The cost and time for the construction is


Fig. 4. A track setup.
minimal. Fig. 5 shows an arrangement of the competition. By
attaching an additional receiver to a TV, the audience can see
VCR’s VHF input takes in TV channel 4 signal and produces the actual image seen by the vehicle.
an RS-170 video signal on its VIDEO OUT connector.

F. Video Frame Grabber IV. SOFTWARE


At CSUF we built a low-cost video frame grabber from We tested the vision-guided vehicle on a white floor with a
scratch. The description of the CSUF frame grabber controller black dashed line. The vehicle is supposed to follow the dashed
can be found in Appendix I. line. The software used to achieve this task is written in C. The
first part of the software displays the incoming road image on
G. Interface to the Hand-Held Controller the PC monitor continuously. This was done by writing pixels
into VGA’s video memory directly [4]. Although the VGA
All RC toy cars are equipped with hand-held controller that can display 256 colors at one time, the maximum number of
issues drive commands at 27 or 49 MHz. All control buttons on gray levels that can be shown is only 64. Fig. 6 shows an
the hand-held controller are on/off type mechanical switches. actual road image seen by the vehicle.
Using n-p-n transistors (e.g., 2N3904) we easily constructed Note that the upper portion in Fig. 6 shows the image of
electronic switches that accepted commands from the PC. the surrounding objects. This is possible when the vehicle
travels near the edge of the white floor. The image processing
H. Race Track/Maze task begins with a reduction of the pixels from 512 512
The race track/maze on which the vehicle operates consists to 256 256. Experiments showed this reduction did not
of a white base dotted with black dashed lines as the track. degrade the information significantly. Conversion of the image
Fig. 4 shows an example of a possible setup. to binary representation is the second step. By selecting a
The white base can be easily constructed by taping white proper threshold level, each pixel becomes either completely
poster sheets on the floor. The black dashed lines are made of white or completely black. The storage of the image can then
nonreflecting black paper cut into 1 cm by 2 cm rectangular be achieved with a 256 32-byte array. This is done using
blocks. One can arrange the dashed black lines into a race 1 b, instead of 1 byte, to represent one pixel. Handling the

Authorized licensed use limited to: COLLEGE OF ENGINEERING. Downloaded on May 4, 2009 at 10:52 from IEEE Xplore. Restrictions apply.
256 IEEE TRANSACTIONS ON EDUCATION, VOL. 40, NO. 4, NOVEMBER 1997

image by each pixel is not feasible for two reasons: one is


the effect of noise and the other is the speed of processing.
We applied the spatial digitization [5] with an 8 8-pixel
cell. All 64 pixels within the space covered by the cell are
examined. If the majority of them are black then the cell is
labeled as black and similarly for the white cells. The threshold
level was selected experimentally. Now the road image can be
represented by 32 32 cells with the following data structure:
struct cell
Fig. 7. Frame grabber block diagram.
unsigned char color;
unsigned int group;
; VI. CONCLUSION
struct cell image cell [31] [31]; In this paper a modified micromouse project is proposed.
The current micromouse competition has never achieved a
The first field represents the color of the cell, either black
reasonable participation rate among engineering schools. The
or white. Note that each black block is part of a dashed line
major reasons are: 1) unreasonable maze specifications; 2) high
in Fig. 6 and consists of clusters of black cells. The second
engineering cost, and 3) inadequate computation environment.
field is intended for the following use. Once the road image
The proposed vision-guided autonomous vehicle consists of
has been reduced to 32 32 records, we need to answer three
five major parts: a low-cost radio-controlled toy car, a CCD
questions: How many clusters of black cells are there (i.e.,
camera, a receiver/transmitter, a video frame grabber, and a
how many black blocks)? Where are the clusters’ coordinates?
personal computer. The vision-guided vehicle is controlled
What are the clusters’ shapes? After trying traditional edge-
by a program run on the PC to follow a track or to solve
detection techniques without much success, we proposed an
a maze. The proposed project has the following advantages:
algorithm that solves this problem in real time. The description
1) low-cost track/maze construction; 2) reasonable engineering
of the proposed algorithm is given in Appendix II.
cost with the use of the off-the-shelf components; 3) adequate
computation environment by using PC and PC programming
A. Driving tools; and 4) adequate challenges that satisfy all levels of
Once the coordinates of the blocks are determined, we can students.
plan a trajectory. The starting point of the trajectory is the
nearest black dashed line to the front end of the vehicle. By APPENDIX I
examining the slope of the trajectory a drive decision can be
The frame grabber’s top level block diagram is shown in
made. There are four basic drive decisions: forward, backward,
Fig. 7.
left turn, and right turn.
A low-cost high-speed analog-to-digital converter (HI1175
from Harris; about $7) is used to digitize the analog video
signal. A pin-to-pin compatible part is also available from
V. ADVANTAGES OF THE PROPOSED PROJECT
Texas Instruments. The converter HI1175 has 8-b resolution
We believe that the proposed vision-guided vehicle project and samples at 20 MHz. The video memory buffer consists
will achieve large-scale participation and can be used as an of two 128-Kbytes static random-access memory (SRAM)
effective recruiting tool for the following reasons. CKX581000 from Sony (about $8 each). The memory buffer
1) The track/maze can be easily constructed. is arranged as 128 K by 16 b to implement word transfers
2) All hardware, vehicle, CCD camera, receiver, and trans- between the frame grabber and the PC. A video sync separator
mitter are commonly available at a reasonable price. Al- (LM 1881 from National Semiconductor, about $2) is used to
though we built the frame grabber at CSUF, commodity- generate composite sync output, vertical sync output, burst
priced frame grabbers are showing up in stores for output, and odd/even output. The LM1881 data sheet [2]
multimedia applications. offers a very good explanation on the RS-170 signal. An
3) The level of challenge on software can vary to suit application note from Harris Semiconductor [3] is also quite
the student. On the low end, entry level students with helpful. The 74LS688 comparator implements a user-select
one semester programming experience can produce a I/O base address. The control of all signals are done by
working program without too much difficulty. On the a field-programmable gate array (FPGA) (XC3030A from
high end, a championship program can require extensive Xilinx, about $10). The FPGA approach greatly reduces the
knowledge ranging from target recognition, artificial complexity of wiring and is highly recommended. There are
intelligence, to fuzzy logic. two major circuits inside the FPGA. The first part handles
4) There are many young people whose hobbies are com- the data exchange between the frame grabber and the PC’s
puter games and RC controlled cars. Channeling those ISA bus. There is a control register with its bit initializing
hobbies into real education may become popular among the read mode and bit switching between the read mode
students, parents, and educators. and capture mode. When operating in the read mode a one-

Authorized licensed use limited to: COLLEGE OF ENGINEERING. Downloaded on May 4, 2009 at 10:52 from IEEE Xplore. Restrictions apply.
CHEN: A VISION-GUIDED AUTONOMOUS VEHICLE 257

word register is used to buffer data transferred from the frame


grabber memory to the PC’s memory. This is necessary to
ensure that when the PC is reading one word the next word
is clocked into the buffer. The second circuit is an address
generator. In the read mode a read signal from the PC generates
a delayed pulse that advances the address generator to the next
address. By doing so, one frame of image can be transferred
to the PC memory by reading the same I/O address 131 072
times. In the capture mode, the address generator is driven by a
free-running crystal oscillator for the first 512 counts. Counts
above 512 are driven by the horizontal sync signal coming
from LM1881.
Using this approach any mis-synchronization will be Fig. 8. The frame grabber built at CSUF.
restricted to within one video line instead of propagating
throughout the whole image. The vertical sync signal is used gsummary[gnumber].q ++;
to reinitialize the address counter. The even/odd frame signal gsummary[gnumber].rowsum
directs the data flow to the even memory bank or to the odd = gsummary[gnumber].rowsum + row;
memory bank. The CSUF-built frame grabber shown in Fig. 8 gsummary[gnumber].colsum
was used to produce all the pictures in this paper. = gsummary[gnumber].colsum + col;
gsummary[gnumber].rowave
APPENDIX II = gsummary[gnumber].rowsum/gsummary[gnumber].q;
The group1 function scans through each image cell. If the gsummary[gnumber].colave = gsummary
cell is black and still has the original initialized group number, [gnumber].colsum/gsummary[gnumber].q;
we then assign the next available group number to this image /* check left */
cell and perform a roundup operation. if (col 1)

void group1(void) if (imacell[row][col-1].color==1


&& imacell[row][col-1].group == 0)
int row, col;
for (t=0; t 50; t++) imacell[row][col-1].group=gnumber;
roundup(row, col-1);
gsummary[t].q=0;
gsummary[t].rowsum=0;
gsummary[t].colsum=0; /* check right */
if (col 30)
for (row=0; row 31; row++)
if (imacell[row][col+1].color==1
for (col=0; col 31; col++) && imcell[row][col+1].group == 0)

if (imacell[row][col].status imacell[row][col+1].group=gnumber;
&& imacell[row][col].group 0) roundup(row, col+1);

gnumber++;
roundup(row,col); /* check up */
if (row 1)

if (imacell[row-1][col].color==1
/* end of group1 */ && imacell[row-1][col].group == 0)
The function roundup recruits all neighboring black cells
imacell[row-1][col].group=gnumber;
that are directly or indirectly (through other neighbors) con-
roundup(row-1, col);
nected to the starting image cell. During the rounding up
process, the number of cells and their averaged column along
with the row coordinates of the same group are computed. The
/* check down */
following is the listing of the function roundup
if (row 30)
/* This is a recursive call */
void roundup(int row, int col) if (imacell[row+1][col].color==1
&& imacell[row+1][col].group == 0)

Authorized licensed use limited to: COLLEGE OF ENGINEERING. Downloaded on May 4, 2009 at 10:52 from IEEE Xplore. Restrictions apply.
258 IEEE TRANSACTIONS ON EDUCATION, VOL. 40, NO. 4, NOVEMBER 1997

REFERENCES
imacell[row+1][col].group=gnumber; [1] N. Chen, H. Chung, and Y. K. Kwon, “Integration of micromouse
roundup(row+1, col); project with undergraduate curriculum: A large-scale student partici-
pation approach,” IEEE Trans. Educ., vol. 38, pp. 136–144, May 1995.
[2] “LM1881 video sync separator,” Application Note, National Semicon-
ductor.
/* end of roundup */ [3] P. Louzon, “Circuit considerations in imaging applications,” Application
Running the above algorithm yields the following answers: Note AN9313.1, Harris Semiconductor.
[4] M. Abrash, Zen of Graphics Programming. Coriolis Group Books,
a) The number of groups (clusters). 1995.
b) The size of each group. [5] M. C. Fairhurst, Computer Vision for Robotic Systems: An Introduction.
c) The center of gravity of each group. Englewood Cliffs, NJ: Prentice-Hall, 1988.

Although the shape of each group is not determined, further Ning Chen graduated from the National Cheng-Kung University, Tainan,
processing is possible. For example, computing the standard Taiwan, in 1978 with the B.S. degree in hydraulics engineering and received
deviation of the column and row may yield a good estimate the M.S. and Ph.D. degrees, both in electrical engineering, from the Colorado
State University, Fort Collins, in 1984 and 1986, respectively.
of the cluster. A rigorous check of all coordinates of the cells After a postdoctoral appointment at the University of Illinois at Urbana-
within each group can definitely yield the shape of the group. Champaign, he joined the faculty at California State University, Fullerton,
The size and the shape of each group can then be used to weed in 1987. He is currently Associate Professor in the Department of Computer
Science and in the Department of Electrical Engineering at the California
out false blocks such as the objects that appear on the upper State University, Fullerton. His major research interests are in the fields of
corners of Fig. 6. robotics, real-time embedded systems, and artificial intelligence.

Authorized licensed use limited to: COLLEGE OF ENGINEERING. Downloaded on May 4, 2009 at 10:52 from IEEE Xplore. Restrictions apply.

You might also like