Self Parking Fpga
Self Parking Fpga
Self Parking Fpga
discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/224056595
CITATIONS READS
8 600
7 authors, including:
Some of the authors of this publication are also working on these related projects:
Developing Next Generation Intelligent Vehicular Network and Applications (DIVA) View project
All content following this page was uploaded by Fakhri Karray on 20 July 2014.
Insop Song, Keith Gowan, Jason Nery, Henrick Han, Tony Sheng, Howard Li, Fakhreddine Karray
NEG Z POS
1.0
-8 -4 0 4 8
Fig. 2. Sensor location on the side of the robot car. Fig. 3. Fuzzy membership function of input variable.
way. Following section describes a the fuzzy controller de- to the side wall. f4 has this value; we obtain these zi values
sign and its experimental results. from expert knowledge and simulations.
R1 : IF x is ZERO and y is ZERO, T HEN θ is f1
3. INTELLIGENT PARKING SYSTEM DESIGN
R2 : IF x is P OS and y is ZERO, T HEN θ is f2
In this section, we describe FLC design of wall following R3 : IF x is N EG and y is ZERO, T HEN θ is f3
module, which is a main part of parking task. This wall R4 : IF x is ZERO and y is P OS, T HEN θ is f4
following task controls the robot car to maintain a given dis- R5 : IF x is P OS and y is P OS, T HEN θ is f5
tance from side objects using FLC. Then, in the next sub- R6 : IF x is N EG and y is P OS, T HEN θ is f6
section, a central controller is explained. The central con- R7 : IF x is ZERO and y is N EG, T HEN θ is f7
troller is a finite state machine that include driving experts R8 : IF x is P OS and y is N EG, T HEN θ is f8
knowledge of performing back parallel parking. R9 : IF x is N EG and y is N EG, T HEN θ is f9
3.1. Fuzzy Logic Controller Design for Wall Following (2)
After fuzzification and fuzzy inferencing using fuzzy rule
Fuzzy logic controller is designed and simulated to main- base, a final step has to be done, which is converting fuzzy
tain given distances from side objects, such as curbs or other values to crisp values in order to actually steer the robot to
cars. This wall following task is accomplished by measure follow wall, i.e. defuzzification step. Defuzzificaiton is per-
the side distance from two locations of the car: front side formed as in (4). fi are from fuzzy rule base and a weighting
and back side. As show in Figure 2, there are three sensors parameter wi is calculated from the membership operation
on the side of the robot, and there are two other sensors on shown in (3). wi is obtained by either “min” operation or
each front and the back of the robot car. The main sensors “product” operation shown in (3). θ, crisp value, is obtained
that are used in wall following task are D3 , front side sensor by (4).
and D4 , back side sensor. Dw is defined a given reference wi = min[µAi (x), µB i (y)] (3)
distance to be maintained as in Figure 2. ,where µAi (x) is the membership function of x and µB i (x)
is the membership function of y.
With these three values, we define two input variables 9
for FLC as in (1). x in (1) and in Figure 2 is a measure of i=1 wi · fi
θ= 9 (4)
the angle of the car reference to the side wall. It tells us that i=1 wi
how steep the robot is with the angle towards the side wall. Using the FLC wall following, the robot car can follow
On the other hand, y in (1) and in Figure 2 is a measure short distance as well as far distance wall following task.
of a distance shows how far the car is off from the given
reference distance, Dw . 3.2. Central Controller Design for Parallel Parking
To accomplish full automated parallel parking, we designed
x = D4 − D3
(1) a central controller. It is composed with FSM that checks
y = D4 − DW
corresponding sensor values and controls the car steering
Membership function is designed for two inputs, x and and direction. It is a very complicated FSM; however, we
y, as shown in Figure 3, horizontal axis is measured dis- try to simplify and show only important state operations and
tance. It is intentionally designed simple for hardware im- state transition conditions as shown in Figure 4.
plementation of fuzzificaiton, so we only use three fuzzy State 1 performs short distance wall following using FLC
variables: Z is zero, POS is positive, and NEG is nega- until a gap (a parking space candidate) is detected, which is
tive. These membership functions are simple triangular type transition condition A. Then in State 2, the robot changes its
membership functions. mode to far wall following also using FLC until the gap is
Using human expert knowledge, fuzzy rule base is de- ended, which is transition condition B.
signed as in (2). θ is a steering angle of the robot car. For After the gap is finished, in State 3, based on time taken
example, as in R4 if x, an angle measure, is ZERO and y, and the speed of the car, we can find out how big is the park-
distance measure, is P OS, then we can turn steering much ing size. Thus, if the gap size is big enough for parking, then
Start C
If space is not
enough for parking
1 2 3
6 5
F Move back & E
Stop & move
steer straight
foward Back & side
Back sensor & left back sensor
triggerred triggerred
Front
sensor
FLC FLC is used 4 Fig. 5. A cut out picture of the robot car. Inside the robot,
is
triggered
G
used If too far
Move back & there are two boards: Altera board and custom made daugh-
from side
curb turn hard right ter board.
End H
of one of the parameter setting menus. Figure 8(b) shows o_pos[9..0] p1 Adder:DenAdder
i_clk
Adder:DenAdder
i_clk
i_distance
a screen capture of a robot run on simulator on a IBM PC. [9..0] fuzzifier2
m4
m5
i_input1[9..0] o_val[31..0]
i_input2[9..0]
i_input1[9..0] o_val[31..0]
i_input2[9..0]
n2 m6 i_input3[9..0] i_input3[9..0]
Figure 8(c) shows a screen capture of FLC VHDL code gen- i_clk o_neg[9..0]
i_data[9..0] o_zero[9..0] z2 Adder:DenAdder
o_pos[9..0] p2 i_clk
eration. i_angle m7 i_input1[9..0] o_val[31..0]
m8 i_input2[9..0]
[9..0] m9 i_input3[9..0]
5.2. Back Parallel Parking
First, we test wall following by FLC. In Figure 9(a), a short
Fig. 7. VHDL modules of FLC. Inside details of FLC block
distance wall following mode is activated as long as there
in Figure 6
is no big parking space is existed on the side, such as up to
number 1 in the Figure 9(a), the car maintains short distance
from the side curb using FLC. After passing number 1 in based design is much reduced compared to that of software
Figure 9(a), the car changes its mode to the far distance wall based design. It is because that, in hardware designs, most
following until it passes number 3, another close distance of the logics are synthesized in parallel; thus operations can
object. As shown in Figure 9(a), the car tries to maintain the be processed parallel. (2) real-time design requirements are
predefined distance. After the number 3 in Figure 9(a), the easier to met then ones with multi-thread software based de-
car calculates a parking space that just passed, if it is long sign under RTOS. In future work, we want to integrate the
enough for parking or not. FLC hardware accelerator (FPGA-based FLC), as a hard-
If it is long enough, the car changes its from state 3 to ware thread, with a software & CPU based automatic control
state 4 as in Figure 4. As in Figure 9(b), starting from num- (or other FLC reqired) systems. Then, both flexible and fast
ber 4, the car backs with hard right turn until it has objects response control system are expected, and less complicated
detected on side and back side sensors. Then it releases its real-time design requirements should be tested.
steering to straight and to soft left as at number 5 in Figure 7. REFERENCES
9(b). Then, FLC shorter wall following in backward direc-
tion is triggered and steers the car. It keeps backing up till [1] E. Batista, “Park without dings – or drivers,” Wired News,
an object is detected by the back sensor as at number 6 in August 25 2003. [Online]. Available: http://www.wired.com/
Figure 9(b). news/technology/0,1282,60154,00.html
As shown in Figure 9(c), the car moves forward till front [2] I. Song, F. Karray, Y. Dai, M. Masmoudi, and B. Ghaddar, “An
sensor is triggered. It stops in the middle of the parking intelligent car-like robot parking system design and implemen-
tation,” in Proceedings of Third IEEE International Confer-
space. This forward movement is also helped by shorter dis-
ence on Conference on Systems, Signals Devices, SSD, 2005.
tance wall following FLC.
[3] “www.altera.com.”
6. CONCLUSIONS [4] F. Karray and C. W. D. Silva, Soft Computing and Tools of In-
We design, simulate, and test FPGA-based automated park- telligent Systems Design: Theory and Applications. Addison
ing system with both a simulator and an actual robot car. Wesley, 2003.
The advantages of using hardware vs. software-based de- [5] L.-X. Wang, A Course in Fuzzy Systems and Control. Upper
sign are as follows: (1) the computation time of hardware Saddle River, New Jersey: Prentice Hall, 1997.
2
1 3
(a) State 1, 2, 3.
5
6
7 8
(c) State 6.