DSP-based Fuzzy Controllers: Application to Parking an Autonomous Robot
ABSTRACT This material is presented to ensure timely dissemination of scholarly and technical work. Copyright and all rights therein are retained by authors or by other copyright holders. All persons copying this information are expected to adhere to the terms and constraints invoked by each author's copyright. In most cases, these works may not be reposted without the explicit permission of the copyright holder. Abstract—This paper describes how to design fuzzy controllers meeting the hardware constraints of digital signal processors (DSPs). Fuzzy controllers are used in many applications because of their rapid design by translating heuristic knowledge, robustness against perturbations, and smoothness in the control action. However, they require parallel processing and special operators (such as fuzzification or defuzzification) which are not available at standard DSPs, thus making inefficient its direct implementation. The idea followed in this paper is to translate the fuzzy rule bases of a fuzzy controller into non fuzzy ones that can be implemented easily by using the relational and logical operators, the standard if-then conditional statements, and the addition and multiplication operators available at a DSP. This is done by using hierarchical structures and adequate membership functions, connective operators, and inference methods. The parking problem of an autonomous robot is described to illustrate this design process. Experimental results show the efficiency of the designed fuzzy controller embedded into a stand-alone card based on a fixed-point DSP from Texas Instruments.
-
Citations (0)
-
Cited In (0)
Page 1
DSP-BASED FUZZY CONTROLLERS: APPLICATION TO
PARKING AN AUTONOMOUS ROBOT
I. Baturone1, F. J. Moreno-Velo1, S. Sánchez-Solano1, V. Blanco2, J. Ferruz2
1 Instituto de Microelectrónica de Sevilla - Centro Nacional de Microelectrónica
Avda. Reina Mercedes s/n, (Edif. CICA). E-41012, Sevilla, Spain
2 Dep. Ingeniería de Sistemas y Automática. E.S.Ingenieros.
Camino de los Descubrimientos s/n. 41092, Sevilla, Spain
Proc. XIX Conference on Design of Circuits and Integrated Systems (DCIS 2004),
pp. 133-138, Bordeaux, November 24-26, 2004.
This material is presented to ensure timely dissemination of scholarly and technical work. Copyright and all rights
therein are retained by authors or by other copyright holders. All persons copying this information are expected to adhere
to the terms and constraints invoked by each author’s copyright. In most cases, these works may not be reposted without
the explicit permission of the copyright holder.
Page 2
Abstract—This paper describes how to design fuzzy
controllers meeting the hardware constraints of digital signal
processors (DSPs). Fuzzy controllers are used in many
applications because of their rapid design by translating
heuristic knowledge, robustness against perturbations, and
smoothness in the control action. However, they require
parallel processing and special operators (such as fuzzification
or defuzzification) which are not available at standard DSPs,
thus making inefficient its direct implementation. The idea
followed in this paper is to translate the fuzzy rule bases of a
fuzzy controller into non fuzzy ones that can be implemented
easily by using the relational and logical operators, the
standard if-then conditional statements, and the addition and
multiplication operators available at a DSP. This is done by
using hierarchical structures and adequate membership
functions, connective operators, and inference methods. The
parking problem of an autonomous robot is described to
illustrate this design process. Experimental results show the
efficiency of the designed fuzzy controller embedded into a
stand-alone card based on a fixed-point DSP from Texas
Instruments.
Index Terms— Fuzzy control, DSPs, embedded controllers,
autonomous robots.
I. INTRODUCTION
ESIGN and implementation of a fuzzy controller
obviously depends on the requirements of the
application towards which it is addressed. Four require-
ments are particularly relevant: the flexibility in the design
(any kind of membership function and fuzzy operators, a
large number of rules, etc.), the time available for rule
processing, the size it can occupy, and the power it can
consume.
In the application field of autonomous mobile robots
Manuscript received April 12, 2004. This work was supported in part by
the Spanish CICYT Projects DPI2002-04401 and TIC2001-1726.
I. Baturone is with the Instituto de Microelectrónica de Sevilla, Centro
Nacional de Microelectrónica
(corresponding author to provide phone: +34-955-056-666; fax: +34-955-
056-686; e-mail: lumi@imse.cnm.es).
F. J. Moreno Velo is with the Instituto de Microelectrónica de Sevilla,
Centro Nacional de Microelectrónica (IMSE-CNM), Sevilla, SPAIN (e-
mail: velo@imse.cnm.es).
S. Sánchez Solano is with the Instituto de Microelectrónica de Sevilla,
Centro Nacional de Microelectrónica (IMSE-CNM), Sevilla, SPAIN (e-
mail: santiago@imse.cnm.es).
V. Blanco is with the Departamento de Ingeniería de Sistemas y
Automática, Universidad de Sevilla,
vmblanco@cartuja.us.es).
J. Ferruz is with the Departamento de Ingeniería de Sistemas y
Automática, Universidad de Sevilla,
ferruz@cartuja.us.es).
(IMSE-CNM), Sevilla, SPAIN
Sevilla, SPAIN (email:
Sevilla, SPAIN (email:
(capable of performing tasks without the intervention of
human operators) built-in machine intelligence and an on-
board control system are required. Fuzzy logic has been
employed widely in autonomous robots to provide
intelligence in solving many tasks, in particular the task of
parking, which is the one addressed in this paper [1-3]. The
trend in many autonomous robots (such as planetary
exploration vehicles, unmanned
microrobots, etc.) is that the on-board control system is
restricted to a small size, light weight, and low power
consumption. This means the need for embedded controllers
capable of real-time operation because, unlike general-
purpose computers, embedded systems are designed and
optimized to provide specific functionality. An embedded
system may be implemented with a number of technologies:
(a) embedded software on off-the-shelf components:
general-purpose (microprocessors) or specific processors
(microcontrollers and digital signal processors or DSPs),
(b) programmable logic (such as FPGAs), and (c) full-
custom or semi-custom ASICs. This paper is focused on
DSP-based embedded fuzzy controllers.
DSPs are designed specifically for implementing real-
time signal processing operations, like convolutions or
correlations, but are not efficient for performing certain
basic operations of fuzzy inference methods, like minimum,
maximum or defuzzification. One solution to reduce this
limitation is to modify or extend the DSP so as to be
adequate for fuzzy operations. The other solution is to
design the fuzzy controller so as to be adequate for the DSP
capabilities. This paper is focused on the second solution
and, hence, three issues are pursued in the design of the
fuzzy controller: hierarchical structures (to reduce the
number of rules and, therefore, the number of operations to
be demanded in parallel), exploitation of symmetry (to
reduce the number of data and operations to be carried out),
and the choice of membership functions, connective
operators, and inference methods suited to the DSP central
processing unit.
This paper is structured as follows. Section II summarizes
the features of the DSP platform that controls the
autonomous robot ROMEO 4R, a car-like vehicle designed
and built at the Escuela Superior de Ingenieros de Sevilla
[4]. Section III describes the parking problem addressed and
its geometric, kinematic, and dynamic constraints. The
design of an efficient fuzzy controller meeting the hardware
constraints imposed by the embedded platform is addressed
in Section IV. Several experimental results of diagonal
parking maneuvers are included in Section V to illustrate
aerial vehicles,
DSP-based Fuzzy Controllers: Application to
Parking an Autonomous Robot
Iluminada Baturone, Francisco J. Moreno-Velo, Santiago Sánchez-Solano, Víctor Blanco,
and Joaquín Ferruz
D
- 133 -DCIS 2004 ISBN 2-9522971-0-X
Page 3
the efficiency and robustness of the designed controller.
Finally, conclusions are given in Section VI.
II. FEATURES OF THE DSP PLATFORM
ROMEO 4R is an electrical vehicle provided with a set of
sensors and actuators that make it capable of autonomous
navigation (Fig. 1). The information collected by the sensors
and that required by the actuators is centralized by a stand-
alone card from Spectrum Digital (the LF2407 EVM) [5].
This card, whose block diagram is shown in Fig. 2, is
shipped with: (1) a TMS320LF2407 DSP from Texas
Instruments (where all the operations required by the low-
level control algorithms are implemented, as well as the
high-level fuzzy controller described herein), (2) LF2407
external memory (128 K SRAM), (3) Digital to Analog
Interface (four 12-bit D/A channels, which are used to
address the traction and steering motor control cards), (4)
SPI logging interface (adapted to receive information from a
gyroscope), (5) expansion interface (used to receive
information from traction and steering encoders), (6) serial
interface (used to communication with an external PC which
defines the task to be performed by the robot and collects
experimental data or any possible error message), (7) JTAG
interface (used to load, execute and debug the programs into
the DSP), (8) LEDs and switches, and (9) CAN interface
(not used currently).
The TMS320LF2407 is a fixed-point DSP of the
TMS320 family which combines onto a single chip the real-
time processing capability of a DSP core with the
peripherals of a microcontroller (two event-manager
modules, a 10-bit analog-to-digital converter, etc.) so as to
meet a wide range of digital motor control and embedded
control applications [6]. It uses a Harvard-type architecture
which contains two separate memory bus structures
(program and data) for allowing data and instructions to be
read simultaneously. This, together with a four-deep
pipeline, allows executing most instructions in a single cycle
of 33ns (30 MHz), being able to reach a performance of 30
MIPS. The on chip memory includes 32 K words of 16 bits
of Flash EEPROM and 2.5 K words of 16 bits of
Data/Program RAM. The central processing unit of this
DSP contains: (a) a 32-bit central arithmetic logic unit
(which can perform 16-bit addition and subtraction, Boolean
logic operations, and bit testing, shifting, and rotating), (b) a
32-bit accumulator, (c) input and output data-scaling
shifters, (d) a 16-bit x 16-bit multiplier, (e) a product-
scaling shifter, and (f) data- and program-address generation
logic. The fuzzy controller described herein has been
designed to meet these hardware constraints.
Texas Instruments provides several tools to work with its
DSPs, in particular, ANSI C compiler, assembler/linker, and
the Code Composer StudioTM development environment,
which allows building and debugging real-time software
applications. This environment has been employed to
develop and load into the DSP a software interface
(programmed in C) which accesses the sensors and actuators
of the robot, implements the low-level PID controllers, and
manages the different tasks. Having this interface, the high-
level fuzzy control algorithm is relieved of the task of
synchronizing the read and write processes of the different
robot devices. The designed fuzzy controller described in
the following has been also loaded into the DSP by using
the Code Composer Studio.
III. DESCRIPTION OF THE PARKING PROBLEM
The problem addressed in this paper is the diagonal
parking of a car-like autonomous vehicle in a constrained
space. Starting from any given position (x, y), and
orientation (φ), the vehicle can drive forward and backward
but has to arrive backward at the desired parking place at a
right angle with the horizontal and to stop there. Fig. 3
shows an scheme of this problem.
In our application, the robot knows its position,
orientation, and driving speed by processing the information
provided by a gyroscope and several encoders in the traction
wheels and in the direction. With this information, the low-
level control of the vehicle applies odometry by using a
simple kinematic model usually employed for car-like robot:
Fig. 2. Block diagram of the LF2407 EVM card.
Fig. 1. The autonomousrobot ROMEO 4R. Fig. 1. The autonomousrobot ROMEO 4R.
- 134 -DCIS 2004 ISBN 2-9522971-0-X
Page 4
⎪⎩
⎪⎨
⎧
⋅=
⋅=
φ
&
⋅=
v
vy
&
vx
&
γ
φ
φ
)cos(
)sin(
(1)
where (x, y) are the coordinates of the vehicle rear axle
midpoint, φ is the robot orientation with the vertical, v is the
speed, and γ is the vehicle curvature.
Once known its current configuration (x, y, φ, v), the
robot has to control the values of its new speed (magnitude
and driving direction) and its new curvature (v, γ) to achieve
a good parking maneuver. The kinematic constraints of the
robot impose that changes in the curvature can not be done
abruptly if the speed is not zero. The dynamic constraints
also call for soft changes in the speed, especially when the
driving direction is switched between backward and
forward.
The goal when driving forward is to lead the robot
towards a configuration with x = 0 and φ = 0 (the vertical
through the center of the parking place), so as to finish the
parking maneuver by driving backward with an almost zero
curvature. The approaching to the vertical is wanted to be
done by approximating a short trajectory made up of arcs of
circles of minimum turning radius and straight lines parallel
to the line of cars (to avoid collisions and reduce the y
distance traveled). These trajectories are shown in Fig. 4a.
The goal when driving backward is that the robot reaches
the parking place with the target final configuration.
Similarly to the forward maneuvers, the desired trajectories
are made up of arcs of circles of minimum radius and
straight line segments parallel to the line of cars, as shown
in Fig. 4b.
IV. FUZZY CONTROLLER DESIGN
The approximation we have taken to design this
controller is to directly emulate what we would do as
drivers. In this sense, our first control action is to decide the
direction of driving (the sign of the speed): backward or
forward, and the magnitude of the speed. This decision is
dynamic because it takes into account not only the current
position and orientation of the vehicle but also its previous
speed. This knowledge is included into a rule base that we
call “direction”.
In addition, the constraints imposed by ROMEO 4R have
to be considered when deciding the new speed. For
example, the change of driving direction has to be soft since
ROMEO has not an electronically controlled brake,
currently. This means that the controller should never
decide to go forward at a rather high speed if previously, the
vehicle was driving backward at a rather high speed. This
kind of constraints is considered by a rule base that we call
“brake”. The input variables of this rule base are the speed
decided by the rule base “direction” and the previous speed.
Its output is the new speed that will be adopted by ROMEO.
The second decision is to select the proper angle of the
wheels once we have decided to drive backward or forward.
The speed selected by the rule base “brake” together with
the x position and the orientation of the vehicle are the input
variables of another rule base that we call “wheel”.
The resulting fuzzy controller structure is hierarchical, as
shown in Fig. 5.
The rules of the modules “direction” and “brake” are
easily defined from our heuristic knowledge. For example,
two rules of the module “direction” are the following:
1.- “If the y robot coordinate is near the cars of the parking
place and the robot orientation φ is greater than
approximately –90º and smaller than approximately 90º and
the x coordinate is not approximately zero or the orientation
is not approximately zero, the driving direction should be
forward to avoid collision with the parked cars”.
2.- “If the y robot coordinate is far from the cars of the
parking place, the driving direction should be backward
since there is no risk of collision”.
Examples of rules of the module “brake” are the
following:
1.- “If the speed decided by the module direction is forward
and the current robot speed v is negative big, the robot
should be stopped to not change abruptly its driving
direction”.
Fig. 3. Theparking problem addressed in thispaper.Fig. 3. Theparking problem addressed in thispaper.
φφ
yy
xx
Fig. 4. Example of ideal trajectories to be performed by the robot when
driving (a) forward and (b) backward.
x
y
x
y
(a) (b)
DirectionDirection
x
φ
yy
vv
BrakeBrake
WheelWheel
vv
γ γγ γ
Fig. 5. Structureof thefuzzy controller.Fig. 5. Structureof thefuzzy controller.
x
φ
- 135 -DCIS 2004ISBN 2-9522971-0-X
Page 5
2.- “If the speed decided by the module direction is forward
and the current robot speed v is greater than negative small,
the new speed of the robot should be forward since there is
no risk of abrupt change in the driving direction”.
The above mentioned rules are fuzzy because they
include fuzzy concepts like near, far, approximately zero,
negative big, or negative small, which are represented by
fuzzy sets. As a matter of fact, the universes of discourse of
the input variables x, φ, y, and v are covered by membership
functions, while the output variable v can take three
singleton or discrete values: stop (0 m/s), forward (1 m/s) or
backward (-1 m/s). The output of the rule bases “direction”
and “brake” takes one of these discrete values by applying a
maximum-type defuzzification process, that is, the output
value is the consequent value of the most active rule. Hence,
the description of the rule bases is done in a fuzzy way
because it is much simpler (it is reduced to translating
heuristic knowledge), but the output of applying these rule
bases to a given premise is not a fuzzy but a discrete value.
For example, Fig. 6 represents the driving direction
provided by the module “direction” versus x and y when φ is
0 and v is 0.
Implementation of these rule bases into the DSP could be
done by implementing directly the stages of the inference
process: fuzzification (calculation of the membership
degrees of each input variable to each fuzzy set in the rule
antecedents), connection of the antecedents (for instance
with the connective “and”) to compute the activation degree
of each rule, determining the rule with the maximum
activation degree and giving its consequent value as output
of the rule base [7]. However, we have followed another
implementation approach which is simpler: instead of
implementing the stages of the fuzzy inference process to
obtain a non fuzzy output, we firstly translate the fuzzy rule
base into a non fuzzy one and implement the latter. The non
fuzzy rule base does not need special operations (like
fuzzification or defuzzification) but standard “if-then”
conditional statements and standard relational and logical
operators. For example, the fuzzy rule base “direction” is
translated into the following non fuzzy rule base (expressed
in C code), which is easily compiled into the DSP:
if(y<0.0) way=0;
else if((y<=4.5) && (phi<90.0) &&
(phi>-90.0)) way=1;
else if((y<=10.0) && (v>0))way=1;
else way=-1;
if((y>0.0) && (x<1.25) && (x>-1.25) &&
(phi<12 && (phi>-12)) way=-1;
While the outputs of the rule bases “direction” and
“brake” take discrete values (forward, stop, and backward),
the rule base “wheel” provides a value for the curvature
which can range from its minimum to its maximum.
Designing the rule base “wheel” to provide the short
trajectories depicted in Fig. 4 is a difficult task by applying
heuristic knowledge only. It is better to apply heuristics
after a geometric analysis of the problem. In this way, the
geometric analysis of the forward trajectories shown in Fig.
4a leads to the following mathematical expression for its
curvature, γ:
⎧
==
αφ
if mf
04
where the angle α associated with the switching in the
curvature sign can be calculated as follows:
(
⎪⎩
R being the minimum turning radius corresponding to the
maximum curvature (mf04 = 1/R, mf04n = -1/R).
The symmetry of the problem makes the above
expressions be also valid for the backward trajectories
except for changing the sign of the variable φ.
Equations (2) and (3) are associated with an on-off
control because the γ value presents abrupt changes, and
would require stopping the robot to perform this hard
switching.
One advantage of using a fuzzy rule base is that the
transitions in the γ value can be smoothed so that the robot
can follow approximately the desired trajectories without
stopping and, hence, reducing the power consumption.
Therefore, instead of the sharp decisions represented by
equation (2), fuzzy rules have been employed in a module
named “smoothing” as the following:
1.- IF (φ-α) is negativebig THEN γ is rightbig;
2.- IF (φ-α) is negativesmall THEN γ is rightsmall;
3.- IF (φ-α) is positivesmall THEN γ is leftsmall;
4.- IF (φ-α) is positivebig THEN γ is leftbig;
where negativebig, negativesmall, positivesmall, and
positive-big are fuzzy concepts which have been represented
by the normalized triangular membership functions shown
in Fig. 7, while rightbig, rightsmall, leftsmall, and leftbig
are represented by singleton values (numeric values).
Given particular angles φ and α, the value of γ provided
by this rule base “smoothing” is obtained as a weighted
average of the active rules (by applying a zero-order
Takagi-Sugeno inference method) [8]. The use of
⎪⎩
⎪⎨
<
>
αφ
αφ
γ
ifmf
ifnmf
0
04
(2)
)
⎪⎨
⎧
≥⋅−
<−
2
⋅−
=
Rx ifxsign
RxifRx arx sign
)(
1cos)(
π
α
(3)
forward
backward
(m)
(m)
Fig. 6. Control surface associated with the module “direction”.
- 136 -DCIS 2004ISBN 2-9522971-0-X