Anda di halaman 1dari 5

Intelligent Parallel Parking and Obstacle Avoidance System

Spring 2011 Senior Design Project

Nischal Basnet
Department of Electrical Engineering
University of New Orleans
New Orleans, LA USA
nbasnet@uno.edu
Abstract The objective of our project is to design and
build the Intelligent Parallel Parking and Obstacle Avoidance
System. The system is comprised of autonomous vehicle
navigation and micro-processing systems installed on a model car.
The system measures an available parking space, checks whether
the space is large enough for parking, aligns the car correctly in
the traffic lane and then performs the necessary parallel parking
maneuvers into the parking spot. In addition to parallel parking,
the system can detect static obstacles, like road blocks and
dynamic obstacles, like pedestrians, in the vehicles path. If
dynamic obstacles are detected, the vehicle stops until the
obstacle moves out of the way. If static obstacles are detected, the
vehicle maneuvers around the obstacle ensuring a collision free
trajectory. The product provides an economic solution to
autonomous parallel parking and can be added to any regular
vehicle thus encompassing a wider customer base. The product
provides an economic solution to autonomous parallel parking
and can be added to any regular vehicle thus encompassing a
wider customer base.
Keywords- autonomous vehicle; intelligent parallel parking;
microprocessor; sensors; motor controler; dc motor; servo motor;
stepper motor.

I.

INTRODUCTION

Parallel parking is considered as one of the most difficult


maneuvers to perform while driving. Many drivers, mostly
beginners, face difficulty while parking parallelly as it requires
the driver to perform precisely calculated maneuvers. As a
result, many vehicle companies are conducting research and
designing new autonomous parking system to be added to their
cars. As stated in [1], in 2003, Toyota added Intelligent Parking
Assist System (IPAS) in its two car models Hybrid Prius and
Lexus, becoming the first car manufacturer to introduce
automatic parking system to the customer. Following the lead
of the Toyota, other vehicle companies such as BMW, Ford and
Volkswagen have introduced this feature to their newer car
models.
Our product also looks to tap into the same market that the
above companies are eyeing for, by making the system
affordable and reliable. Also, we have added obstacle detection
system on top of autonomous parallel parking making the
system much safer and reliable.
The parking system of manufactures like Ford only
performs the steering maneuvers and requires the driver
to manually operate the gas pedal. Also, in the presence of an
Department of Electrical Engineering, The University of New Orleans

obstacle, the driver is required to hit the brake manually as


described in [2]. In contrast, the IPPOAS will completely
replace the driver for the purpose of parallel parking.
The design and implementation of our autonomous parallel
parking system was completed in two semesters. During the
first semester we did research on the components, designs and
existing system that perform the same task. By the end of the
first semester we completed our initial design and ordered the
required parts. During the second (current) semester, we
assembled the parts together and built a prototype vehicle to
test our design. We designed and implement the algorithm for
obstacle detection and avoidance system, and parallel parking
system. This paper primarily focuses on microprocessor system
for which I was responsible, along with the other systems that
my team mate worked on.
II.

MICROPROCESSOR SYSTEM

A. Researching for MicroProcessor


While researching for a microprocessor we looked at
various microprocessors and boards. Among these we had
three micro-processing boards that we thought were good for
our project. They were:
1) HCS12: Dragon12 Plus-USB
2) X-board v2.0
3) Arduino UNO

Figure1 HCS12:Dragon12-Plus-USB Board

We were looking at HCS12:Dragon12 board as we had used


a similar HCS12 board in our Micro-Processor 2 class. Hence,

we thought it would be easier for us to learn the programming


and would allow us to save time that would otherwise be used
for learning the programming. However, the cost of
HCS12:Dragon12 board was about $159, which was very high
than what we wanted to spend. Also, it would increase the
overall cost of the project significantly.

microprocessor. It was easily programmed by using Arduino


language (a modified version of C). USB cable could be used
to load program from computer to the board. Also, the cost of
Arduino UNO board was only $28 and was easily available in
US.
B. Arduino UNO
Cost, ease of programming and availability were the three
factors that led us to choose Arduino UNO board. Some of the
features of Arduino UNO board that are important for our
project are:

Figure 2 Xboard v2.0 board

After HCS12:Dragon12 board we were looking for an


economic micro-processing board that was easy to program.
We then came across X-board v2.0 sold at Extremeelectronics.
The board used ATmega32 chip and had an in-built motor
controller. It used C language for programming and USB cable
for loading the program onto the board. Also, the cost of the
board was only Rs1299 (about $30). However, the board was
available only in India and would cost another $40 to be
shipped to US.

Operating Voltage: 1.8 - 5.5V.


14 Digital I/O Pins incl. 6 PWM pins.
4 of the PWM pins will be used for the motor control
(2 for each motor).
4 digital I/O pins will be used for the sensors (1 each
for each sensor).
Programming in Arduino language, which is based
on C/C++.
The Board can be powered by using USB or by using
external power supply.
Arduino IDE software used to communicate between
the board and computer.
Dimension 6.86 cm x 5.33 cm.

C. Motor controller
Controlling the motion of the dc motor directly through
microprocessor is difficult task. Hence, in order to make it
easier to control the dc motors motion, we decided to use a
motor controller chip. For our purpose we choose SN754410
quadruple half-h driver. Using SN754410 we can control
forward, backward and stop motion of the dc motor.

Figure 4 SN754410 chip

III.

Figure 3 Arduino UNO board

Finally, we did further research for microprocessor board


that was cheap and could be brought within US. We then came
across Arduino UNO board made by Italian company Arduino.
Arduino UNO board used ATmega328 chip as its main

PROGRAMMING

The main code of the project is the combination of


algorithms for three different systems: alignment, obstacle
detection and parallel parking. The code for alignment and
obstacle avoidance is written as a function along with the
function for turning left, turning right, moving forward,
moving back, stopping and converting time to distance. The
code for the parallel parking is written in the main function,
loop, which will repeat indefinitely. To make the code stop
after the parking maneuver is completed an infinite loop,
while(1), is entered at the end.

A. Alignment Algorithm
Read distance
from two distance
sensors

Distance from
(Front Sensor >
Back Sensor)

Check to see
distance from
which ultrasonic sensor is
more?

Steer from
current position
to left

Distance from
(Back Sensor >
Front Sensor)

Move until the


front sensor and
back sensor
distances are
equal

Steer from
current position
to right

Figure 4 Algorithm for alignment of vehicle with curb

The flowchart above shows the algorithm for alignment.


As shown in the flowchart the alignment is done using the two
ultrasonic sensors located at the right side of the vehicle.
When the code is executed, it measures the distance from two
sensors and moves the vehicle towards left or right until two
distances are equal. This algorithm is run thrice at the start of
the program to align the vehicle before performing the parallel
parking.
D1

D2

D1>D2 turn
right

D1

Figure 5 Implementation of alignment algorithm

B. Obstacle Detection And Avoidance Algorithm


If obstacle is
detected stop

Yes

Wait to see if
obstacle is removed
(Dynamic or Static
Obstacle)

Turn right and move


until aligned with the
original position
(Time of movement
sum of back and away
from obstacle)

No

Maneuver
around the
obstacle

Avoid
obstacles/Turn
left and move
forward until
no obstacle is
present
towards right

C. Parallel Parking Algorithm


After designing and implementing algorithm for other
system finally we designed the algorithm for the Parallel
parking system. While designing this algorithm, we have
assumed a free space of more than 20 cm to the right side of
the vehicle, to be a potential parking space. Also, parking
space with length more than vehicles length by half will be
considered as park able space as indicated in [3].
Move until
no obstacle
is detected
Turn right and
move until the
vehicle is about
45 degree with
the curb then turn
left and move
back for few
seconds.
Turn right and
move forward and
align the vehicle
to the curb

D2

D2>D1 turn
Left

Move until no
obstacle is
detected

The flowchart above shows the algorithm for obstacle


detection and avoidance. After an obstacle is detected, the
vehicle will wait for about 3 second for the obstacle to move
after which it will consider the obstacle as a static obstacle and
maneuver around it. A counter is used to count up to 18 every
time an obstacle is detected. If the obstacle is removed before
the counter goes to 18, counter will reset and obstacle will be
considered dynamic. If the obstacle is present until the counter
counts to 18, maneuvers to overcome the obstacle is then
executed.

Go back
straight

Stop for
obstacles/
Stop after
3 sec

Figure 6 Flowchart for obstacle detection and avoidance system

Check the
distance to
right using
Ultra-Sonic
sensor

Consider free space


of more than 20 cm
as a parking space
No

Check whether
enough length
of parking space
is covered?

Yes

Is vehicle
(distance
of <
20cm)
detected?

Yes

Move forward
until the back
wheel of the
vehicle is in
line with the
parked vehicle

No

Travel distance
greater than
required length
of parking
space

Figure 7 Flowchart for parallel parking algorithm

The flowchart above shows the algorithm for parallel


parking. Here, whenever the distance sensor on the right of the
vehicle detects a free space of more than 20cm, it will
considered it as a potential parking space and a counter will
start counting to determine its length. If the vehicle reaches
near another parked vehicle then, the counter will stop and
measure the length of the free space it detected. If the length is
enough for parking, the vehicle will maneuver for parallel
parking else it will keep looking for parking space. If another
parked vehicle is not detected then the vehicle will continue
moving straight until it has travelled significantly larger
distance than the one required for parallel parking and will
maneuver for parallel parking.
IV.

INTERFACING MICROPROCESSOR BOARD

Arduino UNO board contains 14 digital input/output pins


and 6 analog input pins. Among the 14 digital pins 6 are pulse
width modulation (PWM) input/output pins. These pins are

used to connect with other components in order to get input or


give output to perform different tasks.
A. DC Motor
Microprocessor was interfaced with DC motor using a hbridge motor controller. Two pins from h-bridge, enable pin
and a driver pin, are connected to the digital input/output pin
of the Arduino board. Here, different input (high or low) is
given from the microprocessor to the two pins of the h-bridge
that will in turn control the forward, backward and the braking
capabilities of the motor.
Following code runs the motor forward.
digitalWrite(motor1Pin, LOW); //set leg 1 of the H-bridge low
digitalWrite(motor2Pin,HIGH);//set leg 2 of the H-bridge high

digitalWrite(LED, LOW);
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);
pinMode(pingPin, INPUT);
duration = pulseIn(pingPin, HIGH);
// convert the time into a distance
mm = microsecondsToCentimeters(duration);
V.

ERRORS AND REMIDIES

B. Servo Motor
Microprocessor was interfaced directly interface with
Servo motor by connecting the control pin from servo, directly
to the digital input/output pin on the Arduino board. Different
values were passed from microprocessor to the servo motor
through the pin indicating where to rotate the front tires. Here,
90 meant straight tires and values less meant turn to left while
more meant turn to right
Following code turns the front wheel from straight to 55
degree to the right.
for(pos = 90; pos <= 145; pos += 1) // turn 55 degree right
{ // in steps of 1 degree
myservo.write(pos);//servo position = variable 'pos'
delay(15); // waits 15ms for the servo
}

While testing for alignment, we kept the vehicle at a certain


angle to the curb. Then, we ran the algorithm on the vehicle
several times. After, running the algorithm for several times
we noticed that the vehicle did not align with the curb
perfectly all the time. In order to fix the problem we looked at
the output from the two ultrasonic sensors and noticed that the
distance measured by the sensors were not always precise. The
distances were off by a few centimeters, especially when the
vehicle was in motion. For the purpose of alignment, we
required more precision in the distance measurement;
therefore, we decided to run the algorithm three separate times
and take three separate distance measurements for each case.
Next, we took the mean of these values in order to get a better
reading. After taking these steps, we were able align the
vehicle with the curb more precisely.

C. Obstacle Sensor
Microprocessor was interfaced with infrared obstacle
sensor by directly connecting the output pin from the sensor to
the analog input pin on the Arduino board. When the sensor
detects an obstacle the sensors output voltage changes and is
read as input by the microprocessor. The change in voltage is
converted to a number to check the presence of the obstacle.
Following code stops the dc motor when obstacle sensor
detects an obstacle.
int distanced1 = analogRead(0);
int distanced2 = analogRead(1);
if ( distanced1 > 900 || distanced2 > 900)
{ //stop when obstacle present
digitalWrite(motor1Pin,LOW);
digitalWrite(motor2Pin, LOW);
}

While testing the algorithm for parallel parking, we noticed


that the sensor at the back of the vehicle gave to many faulty
reading. As a result, the vehicle did not move properly and
kept stopping while backing. To fix this issue we took four
reading each time and used the mean to get the distance of the
obstacle. Even after using median filter we were not able to
completely reduce the error. Hence, we decided to stop only
when four median values indicate that there is an obstacle
near. Using this technique decreased our range slightly but the
vehicle was able to move smoothly while going in reverse.

D. Distance Sensor
Microprocessor was interfaced with ultrasonic obstacle
sensor by directly connecting the output/output pin from the
sensor to the digital input/output pin on the Arduino board.
The microprocessor first sends a high pulse for about 2
microseconds from the sensor. When the pulse hits an obstacle
the sensor receives an echo. The time taken by the sensor to
send signal and receive its echo is then converted to distance.
Following code sends a pulse and converts the time taken
to receive the echo pulse to distance.

ACKNOWLEDGMENT
I would like to thank my teammates, who, over the last two
semesters, have shown tremendous work ethic and group work
skill. We have faced a lot of ups and down while designing
and building the prototype and I am very happy with the
composure and program solving skill that my teammates have
shown. So I would like to thank Abishek Yadav for properly
managing the team, and designing and building the
mechanical system. I would like to thank Ajit Gauli for
designing the sensor and motor systems and helping while
debugging them. I would like to thank Anil Pandey for
designing the power system. The hard work of all the group
members during the last two semesters made the project
successful.

I would like to thank Dr. Parviz Rastgoufard for guiding,


motivating and providing feedbacks which were important for
our project completion. I would like to thank Dr Jeffrey Frank
Gray for helping us out during the initial design phase of the
project. Also, I would like to thank Dr Abdul Alsamman for
sharing his knowledge on handling a microprocessor. Next, I
would like to thank the Department of Electrical Engineering
at University of New Orleans for partially funding our project.
Finally, I would like to thank all of my friend and family
members, whose moral support and interest help me keep
upbeat and work hard on the project.
REFERENCES
[1]
[2]
[3]

ASIN Company
http://www.aisin.com/news/products/060929.html [Online]
Ford Motor Company. http://media.ford.com/article_display.cfm?
article_id=29625 [Online]
Canadas Driving School Directory.
http://www.drivingschool.ca/drivereducation/page7.html. [Online]

Anda mungkin juga menyukai