Beruflich Dokumente
Kultur Dokumente
4915
AbstractWe present an area-efficient method and fieldprogrammable gate array (FPGA) realization for two common
operations in robotics, namely, the following: 1) rotating a vector
in 2-D and 2) aligning a vector in the plane with a specific axis. It
is based on a new coordinate rotation digital computer (CORDIC)
algorithm that is designed to work with a small set of elementary
angles. Unlike conventional CORDIC, the proposed algorithm
does not require a ROM and a full-fledged barrel shifter. The
proposed CORDIC algorithm is used to design hardware-efficient
solutions for two mobile robotic tasks in an indoor environment
without employing division and floating-point calculations. Experiments with a sole low-end FPGA-based robot in static as well as
dynamic environments validate the power of the approach.
Index TermsArea-efficient algorithm, coordinate rotation digital computer (CORDIC), field-programmable gate array (FPGA)
implementation, robotic exploration.
I. I NTRODUCTION
EDICATED and reconfigurable hardware-directed solutions are of tremendous interest in robotics for a variety
of reasons. For online computations, speed is paramount. There
are also scenarios where area- and power-efficient solutions are
valuable. These include robots in hospitals and home automation systems that are battery-driven and can accommodate only
a small payload. Hardware-based solutions also have an impact
on the size and cost of the overall system. Our interest is broadly
in field-programmable gate array (FPGA)-based solutions for
robotic exploration of indoor environments.
This paper considers a core element of many robotic algorithms, namely, the rotation of vectors in a plane (and update
of coordinates for a reference point on a mobile robot) and
develops an area-efficient hardware-directed solution. A classic
algorithm for handling rotations is based on the coordinate
rotation digital computer (CORDIC) [1]. The CORDIC is a
shift-and-add technique for computing a large class of mathematical functions in a hardware. CORDIC-related research has
focused on speed and accuracy improvement [2][4]. There are
Manuscript received December 23, 2007; revised June 15, 2009. First
published June 30, 2009; current version published November 6, 2009.
L. Vachhani is with the Indian Institute of Information Technology,
Design and Manufacturing Kancheepuram, Chennai 600036, India (e-mail:
leena@iiitdm.ac.in).
K. Sridharan is with the Electrical Engineering Department, Indian Institute
of Technology Madras, Chennai 600036, India (e-mail: sridhara@iitm.ac.in).
P. K. Meher is with the Institute for Infocomm Research, Singapore 138632
(e-mail: pkmeher@i2r.a-star.edu.sg).
Color versions of one or more of the figures in this paper are available online
at http://ieeexplore.ieee.org.
Digital Object Identifier 10.1109/TIE.2009.2026225
4916
IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 56, NO. 12, DECEMBER 2009
(1)
Ki = cos tan1 (2i )
(2)
where
Ki is a scale factor
can be accumulated. The vector is
that
scaled by Kn = n (1/ 1 + 22i ).
The CORDIC rotator can work in two modes, namely, rotation and vectoring. In the rotation mode, the angle accumulator
is initialized with the desired angle denoted by Z0 . At each
iteration, the direction of rotation (counterclockwise/clockwise)
denoted by di is given by
+1, if Zi 0
di =
1, otherwise.
The vectoring mode accumulates the angles needed to rotate
a given vector (X0 , Y0 ) for minimizing Yi . The value of Z0 is
initialized to zero in vectoring mode.
A word-serial architecture for the conventional CORDIC is
shown in Fig. 1. The barrel shifters are implemented using
multiplexers whose inputs are wired values that are shifted right
by different amounts. The sel line selects the correct shifted
input. The input mode selects the mode of operation (a mode
of zero indicates rotation mode, while a mode of one indicates
vectoring mode). Section II-A discusses the issues that arise in
implementation of the conventional CORDIC algorithm.
(3)
Yi+1 = Kj (Yi di 2
Xi )
(4)
(5)
(6)
where
0, otherwise
d0 {1, 1} and j {1, 3, 4, 5, 6}.
To start the iterative process given by (4)(6), X0 and Y0 can
be taken to be one and zero, respectively, in the rotation mode,
while Z0 is the desired angle of rotation. The implementation
of the iterative equation for Zi+1 uses the relationship
tan1 (2j ) = 21 tan1 2(j1)
for large values of j. The scale factor Kj is given by
(1/ 1 + 22 ) = 0.8944 for j = 1. Further, for j 3, we have
1 > Kj 0.992, and, therefore, scaling for rotations less than
(or equal to) tan1 23 is ignored. The exact value of Kj does
not have a bearing on the rotation accuracy (of 1 ).
In the vectoring mode, given (Xin , Yin ), multiple clockwise
rotations of tan1 21 are effected if (Xin , Yin ) happens to be
in the second quadrant (equivalently, multiple counterclockwise
tan1 21 rotations if (Xin , Yin ) is in the third quadrant). This
may be followed by multiple rotations of tan1 23 and smaller
angle rotations. Termination is determined by the magnitude of
the second coordinate (in particular, when all but the least two
significant bits become zero).
Remark 1: Wang and Swartzlander [16] present a critically
damped CORDIC algorithm which uses microrotations in one
direction. However, the scheme in [16] uses a ROM, and,
further, ours does not require an explicit multiplier. More details
are presented in the architecture section.
Remark 2: The use of tan1 21 along with an angle larger
than tan1 23 brings in the need of hardware for an additional
scaler. Further, the barrel shifter will no longer have low width.
4917
nk
10
k=1
to converge within 1 for any input angle in the range [0, 180 ].
Proof: In a 12-b representation, 9 b are required for the
integer part to represent all angles in [180 , 180 ), so, we
obtain 3-b approximations for the fractional parts of tan1 21 ,
tan1 23 , tan1 23 /2k , k = 1, 2, 3. The decimal representation in degrees is used for all five angles since it facilitates a
simple proof. The closest representations for the five angles are
26.625 , 7.125 , 3.5 , 1.75 , and 0.875 .
The proof is based on splitting the entire range [0 , 180 ]
into seven parts determined by the representation for tan1 21 .
Suppose we denote the parts by Ri , i = 1, . . . , 7; then it is
clear that the maximum number of iterations (for angles) in
R2 is just one more than the maximum number in R1 (similarly for R3 , R4 , and so on). One can therefore concentrate
on [0 , 26.625 ]. In [0 , 26.625 ], the angles that require
the maximum number of iterations (5) are 21 and 26 (this
has been determined by hand calculations for all angles in
this subrange). In particular, 21 can be expressed as (2
7.125) + 3.5 + 1.75 + 0.875, while 26 can be expressed as
(3 7.125) + 3.5 + 0.875, given the maximum allowable error
of one degree.
4918
IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 56, NO. 12, DECEMBER 2009
(8)
(9)
= 0.8944(Xi + di 2j Yi )
= 0.8944(Yi di 2j Xi )
= 0.890625(Xi + di 2j Yi )
= 0.890625(Yi di 2j Xi ).
(12)
(13)
(14)
(15)
Fig. 2.
4919
tan1 (2j ) = 21 tan1 2(j1)
as from (3)
tan1 2(j1) 2(j1) .
4920
IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 56, NO. 12, DECEMBER 2009
TABLE I
A REA C OMPLEXITY C OMPARISONS
TABLE II
C OMPARISON OF P ERFORMANCE OF D IFFERENT S CHEMES ON FPGA
Fig. 3.
A challenge in mobile robotics is that of performing highlevel tasks when constraints are imposed on the processing component. In this section, we consider a mobile robot
equipped with a sole low-end FPGA for processing. We assume
that there is no external memory and no elaborate peripheral
interfaces so that the cost, area, and energy consumption are
small.
Hardware-efficient solutions based on the new CORDIC
algorithm are presented for: 1) construction of the generalized
Voronoi diagram (GVD) and 2) wall following. While GVD is
chosen in view of large memory requirements, wall following
presents a different type of trajectory for the robot to achieve.
Extensions to a dynamic environment are also presented. While
prior algorithms and implementations exist for Voronoi construction [19], these are limited to static environments for
implementation using general-purpose microprocessors.
A. Construction of GVD
The GVD is the locus of points which are equidistant from
two or more obstacle boundaries including the workspace
Fig. 4.
4921
(x1 , y1 ) and (x2 , y2 ). Then, the nearest point from the origin
on the perpendicular bisector to the line joining (x1 , y1 ) and
(x2 , y2 ) is
Fig. 5.
boundary. The GVD serves as a good map in indoor environments. The GVD consists of Voronoi edges and meet points. A
Voronoi edge is the locus of points equidistant to two nearby
obstacles, while a meet point is equidistant to three or more
obstacles. A meet point determines termination of one edge
and start of another for the robot to explore. An environment
with three obstacles and its GVD (shown by dashed lines) is
presented in Fig. 4. The stretch from V1 to V2 is part of a
Voronoi edge.
For construction of a Voronoi edge by an FPGA, estimation
of the next point on the edge is performed in a hardwareefficient manner. The estimation is followed by rectification
using the distance values provided by the sensors. Consider
Fig. 4. V2 is the present location of the robot. The estimation
of next point Vest is based on the observation that V2 is the
midpoint of V1 and Vest . This is accomplished merely by shift
and subtract operations.
Since an estimated point may not necessarily be on the GVD,
two nearest points on distinct nearby obstacles (A and B)
are identified (based on sensor inputs), and these are used to
confirm an estimated point as being on the GVD or otherwise.
In the latter case, a rectified Voronoi point (denoted by V3
in Fig. 4) is obtained using the proposed CORDIC without
division operations.
The perpendicular bisector to the line joining closest points
on A and B is used to perform the rectification. The closest
point on the perpendicular bisector to the current point is
obtained as shown in Fig. 5.
The computation of the direction and the distance for the
robot to move for reaching the rectified point is based on
the following ideas. For ease of discussion, let the present
position of (a reference point on) the robot be the origin and
its heading direction be the positive X-axis. Further, let the
coordinates of nearest points on two different obstacles be
xp =
(y2 y1 )2 + (x2 x1 )2
2
yp =
(y2 y1 )2 + (x2 x1 )2
2
(16)
xp
2
yp = J L M N y1 +y2
(17)
2
1
1
where
1 0
J = 0 1
0 0
cos
L = sin
0
1 0
M = 0 1
0 0
x1 +x2
2
y1 +y2
2
1
sin
cos
0
0
0
1
cos
x1 +x2
2
+ sin
0
1
y1 +y2
2
N = (L1 )
where
1
= tan
y1 y2
x1 x2
.
4922
IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 56, NO. 12, DECEMBER 2009
Fig. 7. Direction of edges at node when two closest points are at 180 .
coordinates (for computation, does not require robot movement) are [(x1 + x2 /2), (y1 + y2 /2)].
The rotations corresponding to matrices N and L in (17) are
accomplished using CORDIC. The translation component in M
does not require any multipliers since the extent to translate is
known after the rotation by corresponding to the matrix N .
Using the coordinates of rectified point, the distance and the
direction for the robot to reach this rectified point are also found
using CORDIC (in vectoring mode).
Estimation circuit: This module calculates the estimation
point using a shifter and a subtractor as shown in Fig. 10.
Midpoint generation logic: This module facilitates calculation of midpoints. The architecture is shown in Fig. 11.
Information about sensor IDs is used here: Starting from the
front sensor, the sensors are given unique IDs from zero to
seven in increasing order in the counterclockwise direction. In
Fig. 11, the variable mina corresponds to the sensor ID of ath
minimum-distance value (the arguments 2, 1, and 0 refer to the
MSB, middle bit, and LSB, respectively). a and b can be 1, 2,
3, or 4, but a = b. The variable oppositeab is set if mina and
minb are opposite to each other (for example, if min1 = 1 and
min2 = 5, then opposite12 is set to 1). Pa is the closest point on
the nearest obstacle (in the direction of mina ), while Pcurr is the
current position of the robot. Pmidab corresponds to a point on
the edges emanating from a node (If, for example, Pa , Pb , and
Pcurr are not in a straight line and, therefore, oppositeab is 0, it
is assigned as the midpoint of Pa and Pb , else it is assigned as
the mirror image of cth nearest point Pc over the current point
Pcurr ). The comparator and MUX block selects valid points on
each edge with Pmid1 corresponding to the edge from where the
node of interest is reached.
Motor control logic: The coordinates of next point are
converted into distance and direction using the CORDIC unit
in vectoring mode. The robot is first aligned with this direction
by calculating the turning angle with respect to the present
direction of the robot. Then the robot is moved by distance
centimeters. The control logic to drive the motors of the robot
counts the number of steps the motor should receive in order
to rotate by angle or translate by distance centimeters. The
logic drives two 2-phase bipolar stepper motors. These two
(termed as left and right) stepper motors of 1.8 /step are
connected through L297L298 controller-driver pairs to the
respective wheels. The translation movement of 1 cm requires
approximately 30 steps, while rotation by 1 needs seven steps.
The architecture to drive the motors is shown in Fig. 12. The
multiplication by 30 or 7 in the step calculation is achieved
by a subtractor and multiplexers. The multiplication by powers
of two is performed by wiring the shifted values. The down
counter counts the number of steps given to the stepper motor. The stepper-motor driver gets a clock input (denoted by
step_clk) via clock division of the 50-MHz signal on the FPGA
board.
2) FPGA Usage: The usage of the XC2S200E FPGA for
each module in the architecture is shown in Table III. It can be
observed that CORDIC-based rectification consumes roughly
one-third of the FPGA resources (in view of conversion of
(d1 , 1 ) to (x1 , y1 ), . . . , (d4 , 4 ) to (x4 , y4 ), and finally, conversion of rectangular coordinates of the next point to polar
Fig. 8.
Fig. 9.
4923
4924
IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 56, NO. 12, DECEMBER 2009
TABLE III
X ILINX XC2S200E D EVICE U SAGE FOR M ODULES
IN CORDIC-BASED A RCHITECTURE
Fig. 13. Snapshots for the experiment on GVD construction. (a) Starting
point. (b) Estimated point (on the GVD). (c) Next estimated point (off the
GVD). (d) Rectified point.
Fig. 14. Solid lines: Ideal trajectory; Dashed lines: Experimental trajectory.
Fig. 15. Plot of the error between ideal and experimental trajectories.
4925
branches at nodes in advance. The robot explores the environment just once in the dynamic case as well. Branches declared
as occupied by a dynamic obstacle need to be pruned. The
robot waits at each node for a prespecified time (determined by
the sensor range and nominal object speeds). Multiple readings
are taken from each sensor to ascertain the direction of object
movement (based on variations in sensor values).
Modules for dynamic environment: In addition to the
modules for a purely static environment, the architecture for a
dynamic environment has modules to detect the movement and
appropriately adjust the properties of a node. The estimation
circuit requires some changes as well. Data on edges to be
removed is obtained using the architecture shown in Fig. 16.
In essence, sensor information is used to determine edges to be
eliminated. The circuit shown in Fig. 16 outputs the number
of edges to be removed in the case of a node with four edges
in adder4 and in the case of a node with three edges in
adder3 . opposite12 signifies if the sensors corresponding to
two minimum distance values (min1 and min2 ) are 180 apart
(opposite12 bit is one if two minimum sensor readings are
resulting from sensor IDs zero and four). If sensor IDs lying
between min1 and min2 are detecting movement, a flag named
move_btn12 is set.
Removal of edges implies a change in the properties of a
node. The circuit shown in Fig. 17 takes the value of adder4
to transform a node with four branches to one of the following:
node (three branches), boundary point, or a normal point on the
GVD (with just two equidistant objects). Similarly, a node with
three branches is converted using adder3 .
Using adder3 and adder4 , the properties of a node are
changed as shown in Fig. 17. In particular, the value of
dyn_node is used to determine if a node currently having
four branches should become merely a node (three branches).
Similarly, the value of dyn_boundary determines if the present
node should be converted to a boundary point. Conversion to a
normal point on the GVD (two equidistant objects) takes place
if all the three flags (dyn_node4, dyn_node, dyn_boundary) are
reset.
4926
IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 56, NO. 12, DECEMBER 2009
Fig. 21.
Fig. 22. Environment where humans simultaneously move along west, north,
and east of the robot located at node 4.
Fig. 23.
Experiments: Figs. 1821 shows the snapshots of an experiment performed in a 5-m 6-m environment with three
persons moving between three pairs of stations. Fig. 18 shows
the robot coming along an edge. The robot is very close to a
node as shown in Fig. 19. In the position shown in Fig. 20, the
robot takes multiple sensor readings to identify any movements
4927
The robot therefore successfully detects dynamic activity without external memory/buffer support.
The additional FPGA usage for the dynamic case is 744
(15.81%) LUTs and 438 (18.62%) slices. This considers the
edge removal, node conversion, changes in midpoint generation, and checking movement to update adder3 and adder4 .
B. Wall Following by FPGA-Based Robot
In this section, we present a second application of the areaefficient CORDIC. The application involves following a wall
by the FPGA-based robot. The problem of wall following is
a special case of boundary-following problems. The robot can
perform this task using touch sensors; however, the disadvantage is that the robot will then come into contact with the
obstacle/wall. Distance sensors are appropriate here, and the
robot maintains a predefined (constant) distance from the wall.
The trajectory followed is called as the offset path. Clearly,
the offset path is parallel to the wall. The offset path can be
constructed once the correct tangent direction to the wall or
normal to this tangent is known. The sensor is required to
provide information on this normal distance and direction with
respect to the present heading direction of the robot.
While considerable work has been done on wall following
in general, our interest is in hardware-efficient robotic wall
following, and an important element of the wall-following
solution is the CORDIC module. The scheme developed here
finds the exact normal direction to align the robot parallel to
the wall at the offset distance using information from adjacent
ultrasonic sensors placed far apart to avoid crosstalk. The core
is an alignment scheme presented next.
The position of the sensor that gives the minimum-distance
value can be used to determine the approximate direction of the
nearest obstacle (wall). The direction is then corrected using
adjacent sensor readings, which are assumed to give distance
values from the same obstacle (this assumption is valid for the
wall-following task). Fig. 23 shows a scenario and the sensor
readings when the heading direction of the robot is not aligned
4928
IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 56, NO. 12, DECEMBER 2009
involves alignment with the wall and moving along the wall.
The maximum turn required in the alignment phase is 90
which takes roughly 1.53 s for our robot. The step size to move
along the wall is 10 cm, and this takes approximately 0.73 s.
Therefore, wall following at each step requires a maximum of
2.58 s (0.32 s for sensor reading, +1.53 s for turning, +0.73 s
for translating).
V. C ONCLUSION
Fig. 25. Architecture for next-move-decision logic.
This paper has presented an area-efficient CORDIC algorithm. The algorithm is shown to use 50% fewer FPGA resources than a conventional CORDIC implementation. Using
the new CORDIC, this paper has also presented hardwareefficient solutions for two high-level mobile robotic tasks.
R EFERENCES
[18] Xilinx CORDIC V3.0, Product Specification No. DS249, San Jose, CA,
Apr. 2005. [Online]. Available: http://japan.xilinx.com/support/
documentation/ip_documentation/cordic.pdf
[19] R. Mahkovic, Construction of the generalized Voronoi diagram of the
unknown environment, in Proc. IEEE ISIE, 1999, pp. 984989.
4929