Implementation of Parallel Fuzzy Logic Controller in FPGA Circuit For Guiding Electric Wheelchair
Implementation of Parallel Fuzzy Logic Controller in FPGA Circuit For Guiding Electric Wheelchair
UDNRZ3RODQG0D\
Fig. 1. Electric wheelchair. Fig. 2. General block diagram of fuzzy logic system for guiding a
wheelchair.
The electric wheelchair is driven by two permanent
magnet DC motors – M0 and M1 having the power of
II. LINGUISTIC VARIABLES
250[W] each, which are supplied from 24[V] battery
(fig.1). Steering of the wheelchair is based on differential In fig. 3 assumed shapes of fuzzy terms corresponding
control of electric motors driving back wheels of the to input signals (left/ right – l/r, front/ back – f/b) are
wheelchair, allowing driving the wheelchair in left/ right shown. The source of steering signal of the system is a
and onward/ back directions. The task of fuzzy system joystick – JOY (fig. 2), which is constructed of two
(fig. 2) is a generation of output signals (s0,s1), steering variable resistors. These resistors are supplied from a 5
electric motors (M0,M1) based on input signals (left/ right [V] DC battery, and the voltage drops on resistors are
– l/r, front/back – f/b), created by the operator using directly proportional to deflection of the joystick. The
joystick JOY; additionally a feedback signal (ǻv) is used neutral state of the joystick correspond to 2,5 [V] and is
to cancel a difference of rotations of electric motors, while coded as a state “ZE”. The deflection of the joystick from
driving straight on [1][2][3]. neutral state “ZE” in left/ right (or front/ back) causes a
The knowledge, based on which steering signals are change of value of signal l/r (or f/b).
generated is included in fuzzy rules and terms of linguistic Steering of the two motor electric wheelchair requires a
variables. The propossed fuzzy system is based on constant correction of the direction of the drive, because
classical Mamdani model in which one can distinguish the the speed of driving motors differ slightly. Using the
blocks (fig. 2): fuzzification (b_in), inference (b_inf) and feedback signal ǻv proportional to the difference of wheel
rotation speed ǻv allows to correct their speed during
driving straight on, what increases the quality of steering
1-4244-1543-8/08/$25.00
Authorized licensed ©2008
use limited to: NATIONAL INSTITUTE IEEE
OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on September 18,2023 at 11:33:49 UTC from IEEE Xplore. Restrictions apply.
of the wheelchair. Measurement of rotary speed is premises connected by conjunction operator – AND, and
performed by incremental encoders (en0 and en1), which has the form:
are installed on driving wheels. Signal of difference of Ra: If (x0 = A0) AND (x1 = A1) AND (x2 = A2)
wheel speed - ǻv is supplied to input fuzzy system, which then (y0 = B0)
corresponds to input linguistic variable – x2, which fuzzy Rb: If (x0 = A0) AND (x1 = A1) AND (x2 = A2)
terms are shown in figure 4a. then (y1 = B1)
where
x0,x1,x2 – input linguistic variables corresponding to
input signals: p/t, l/p, 'v,
A0,A1,A2 - terms of linguistic variable xi (i=0,1,2),
y0,y1 - output linguistic variable, which corresponding to
output signals p0 and p1,
B0,B1 - terms of linguistic variable yi (i =0,1)
A possible number of rules describing this system
equals to 2*5^3=250 rules or 125 pair of rules. In table 1 a
part of the rule table board, corresponding to driving
motors M0/M1 is presented (assuming that input value of
linguistic variable x2,ҏ ǻv = „ZE”). At sides of the rule
table the increases of values of input linguistic variables
Fig. 3 Fuzzy-sets of input linguistic variable a) l/r and b) f/b (N- negativ, are shown (neutral value marked as the zero – ZE), and in
ZE – zero, P – positiv, B – big, S - small).
the interior of the table output steering signals y0/y1 for
motors M0/M1 are given.
TABLE 1: The Part of the look-up table rules of the fuzzy system
for signal ǻv = „ZE” (n- negativ, ze – zero, p – positiv, b – big, s
- small).
l/r Negative - left ZERO Positiv – right
p/t NB NS ZE PS PB
Positiv PB NS/DD UM/DD DD/DD DD/DM DD/DM
Onward
PS UM/DD ZE/DD DS/DS DD/ZE DD/DM
ZERO ZE ZE/DD ZE/DM ZE/ZE DM/ZE DD/ZE
Negativ NS ZE/UM ZE/UM UM/UM UM/ZE UM/ZE
back
NB ZE/UD ZE/UM UD/UD ZE/UM UD/ZE
– bit codes of fuzzy sets (T0,T1). In the memory of the 0 0 1 100 84 94 010 000 011 010000011
0 1 0 100 16 6 010 001 100 010001100
block „fuzzy_x” altogether 256 of such samples
0 1 1 100 16 94 010 001 011 010001011
describing the input linguistic variables are stored. 1 0 0 0 84 6 011 000 100 011000100
Reading a 3 - byte value of the sample from the memory 1 0 1 0 84 94 011 000 011 011000011
and transferring it to the output mi0, mi1,t of block 1 1 0 0 16 6 011 001 100 011001100
“fuzzy_x” finishes operations of fuzzyfication. Next these 1 1 1 0 16 94 011 001 011 011001011
~
where y - sharp value of output linguistic variable, , hi
– values of membership function for output singletons, yi
– values of locations of output singletons. In hardware
realization, the defuzzification process is performed
parallelly for two output channels in defuzzx (where
x=0,1) blocks. Next this result is transferred into the
block controlling the drive of the wheelchair motors.