Fuzzy Logic - 22
Fuzzy Logic - 22
A paper Presentation on
Speed control of DC Motor by using Fuzzy Logic
By
B .D. V. Nageswara Rao. P.Anantha Naga Dharmapal
Contents
1. Introduction
2. Fuzzy system
a. Fuzzy variables.
b. Membership functions.
c. Rule matrix.
d. Defuzzyfication.
3. Speed control of DC Motor
4. Applications
5. Conclusions
6. References
DocumentToPDF trial version, to remove this mark, please register this software.
IF speed of the motor is greater than 1500 rpm AND the machine stator
temperature is between 60F and 100F
THEN set the stator current I less than 10 amps
Fuzzy control, on the other hand, does not strictly need any
mathematical model of the plant .It is based on plant operator experience and
heuristics, as mentioned Previously, and it is very is to apply. Fuzzy control
is basically an adaptive and nonlinear control, which gives robust
performance for linear or nonlinear plant with parameter variation.
DocumentToPDF trial version, to remove this mark, please register this software.
a. Linguistic Variables :
In 1973, Professor Lotfi Zadeh proposed the concept of linguistic or
"fuzzy" variables. Think of them as linguistic objects or words, rather than
numbers. The sensor input is a noun, e.g. "temperature", "displacement",
"velocity", "flow", "pressure", etc. Since error is just the difference, it can be
thought of the same way. The fuzzy variables themselves are adjectives that
modify the variable (e.g. "large positive" error, "small positive" error ,"zero"
error, "small negative" error, and "large negative" error). As a minimum, one
could simply have "positive", "zero", and "negative" variables for each of
the parameters. Additional ranges such as "very large" and "very small"
could also be added to extend the responsiveness to exceptional or very
nonlinear conditions, but aren't necessary in a basic system.
b. Membership functions:
The membership function is a graphical representation of the magnitude
of participation of each input. It associates a weighting with each of the
inputs that are processed, define functional overlap between inputs, and
ultimately determines an output response. The rules use the input
membership values as weighting factors to determine their influence on the
fuzzy output sets of the final output conclusion. Once the functions are
inferred, scaled, and combined, they are defuzzified into a crisp output
which drives the system. There are different membership functions
associated with each input and output response. Some features to note are:
SHAPE - triangular is common, but bell, trapezoidal, haversine and,
exponential have been used. More complex functions are possible but
require greater computing overhead to implement.. HEIGHT or magnitude
(usually normalized to 1) WIDTH (of the base of function),
SHOULDERING (locks height at maximum if an outer function. Shouldered
functions evaluate as 1.0 past their center) CENTER points (center of the
member function shape) OVERLAP (N&Z, Z&P, typically about 50% of
width but can be less).
DocumentToPDF trial version, to remove this mark, please register this software.
c. Rule Matrix :
In the last article the concept of linguistic variables was presented. The
fuzzy parameters of error (command-feedback) and error-dot (rate-of-
change-of-error) were modified by the adjectives "negative", "zero", and
"positive". To picture this, imagine the simplest practical implementation, a
3-by-3 matrix. The columns represent "negative error", "zero error", and
"positive error" inputs from left to right. The rows represent "negative",
"zero", and "positive" "error-dot" input from top to bottom. This planar
construct is called a rule matrix. It has two input conditions, "error" and
"error-dot", and one output response conclusion (at the intersection of each
row and column). In this case there are nine possible logical product (AND)
output response conclusions.
columns, but definition of all of these rules may not be necessary since some
input conditions may never occur in practical operation. The primary
objective of this construct is to map out the universe of possible inputs while
keeping the system sufficiently under control
d. Defuzzyfication :
Combining the results of the inference process and then computing the
“fuzzy centroid” of the area accomplish the defuzzification of the data into a
crisp output. The weighted strengths of each output their respective output
membership function center points multiply member function and summed.
DocumentToPDF trial version, to remove this mark, please register this software.
Finally, this area is divided by the sum of the weighted member function
strengths and the result is taken as the crisp output. One feature to note is
that since the zero center is at zero, any zero strength will automatically
compute to zero. If the center of the zero function happened to be offset
from zero (which is likely in a real system where heating and cooling effects
are not perfectly equal), then this factor would have an influence.
Figure 8 - The horizontal coordinate of the centeriod is taken as the crisp output
The above speed control system is low cost and suitable for learning at home
where being rigorously, mathematically correct is not required. It is
important to be aware that this speed controller is only an experimental
controller to get familiar with the fuzzy logic concept. It is not what
engineers call a rigorous, technically correct application of fuzzy logic. The
difference is in the fact that this approach does not add triangles to compute
center of mass as specified by Dr. Bart Kosko .Adding triangles can be done,
but is difficult and time consuming, however that is the way a truly
professional application would be designed. There are IC’s that do it all and
commercially available fuzzy logic controllers that do everything correctly.
This fuzzy logic controller project was done under pressure of very limited
money available, resulting in an inexpensive approach. What is needed is
an analog to digital converter, which connects to a PC, and a digital to
analog output device from the PC to the transistors and DC motor-generator
being controlled. Often this is all in one plug-in card that goes inside the
PC. Plug in the A to D and D to A converter in the PC and write a program
DocumentToPDF trial version, to remove this mark, please register this software.
to measure the input and control the output according to fuzzy logic
principles. This approach can be somewhat expensive and was not used in
this case.
In our case, input is the speed in Rpm of the DC motor, for which we are
going to regulate the speed. See Figure 3 above. Speed error between the
speed measured and the target speed of 2,420 Rpm is determined in the
program. Speed error may be positive or negative. We measure the DC
output voltage from the generator. This voltage is proportional to speed.
This speed-proportional voltage is applied to an analog input channel of our
fuzzy logic controller, where the analog to digital converter and the pesonal
computer, including appropriate software, measure it.
2. Determine the control system output. For a home air conditioner, the
output is the opening and closing of the switch that turns the fan and
compressor on and off. For a car's cruise control, the output is the
adjustment of the throttle that causes the car to return to the target speed.
In our case, we have just one control output. This is the voltage connected
to the input of the transistor controlling the motor. See Figure 3.
3. Determine the target set point value, for example 70 degrees F for your
home temperature, or 60 Miles per hour for your car.
For the steam engine project, Professor Mamdani used the following for
input:
Our system is much less complicated, so let us select only three conditions
for input:
RULES
Translate the above into plain English rules (called "linguistic" rules by Dr.
Zadeh). These Rules will appear in the BASIC computer program as "If-
Then" statements:
The next three steps use a charting technique that will lead to a computer
program. The purpose of the computer program is to determine the voltage
to send to the speed controlled motor. One function of the charting technique
is to determine the "degree of membership" (see Ch. 1) of the Too slow,
About right and Too fast triangles, for a given speed. Further, the charting
technique helps make the continuous control feedback loop easier to
visualize, program and fine tune.
5. Associate the above inputs and outputs as causes and effect with a Rules
Chart, as in Figure 4, below. The chart is made with triangles, the use of
which will be explained. Triangles are used, but other shapes, such as bell
curves, could also be used. Triangles work just fine and are easy to work
with. Width of the triangles can vary. Narrow triangles provide tight
control when operating conditions are in their area. Wide triangles provide
looser control. Narrow triangles are usually used in the center, at the set
point (the target speed). For our example, there are three triangles, as can
be seen in Figure 4 (three rules, hence three triangles).
DocumentToPDF trial version, to remove this mark, please register this software.
a. If speed is About right then Not much change needed in voltage to the
speed controller.
c. If speed is Too fast then decrease voltage to the speed controller to Slow
down.
DocumentToPDF trial version, to remove this mark, please register this software.
7. Determine the output that is the voltage that will be sent from the
controller/signal conditioner/transistor to the speed controlled motor. This
calculation is time consuming when done by hand, as we will do below, but
this calculation takes only thousandths of a second when done by a
computer.
Assume something changes in the system causing the speed to increase from
the target speed of 2,420 Rpm to 2,437.4 Rpm, 17.4 Rpm above the 'set
point." Action is needed to "pull" the speed back to 2,420 Rpm. Intuitively
we know we need to reduce the voltage to the motor a little. The "cause"
chart and vertical speed line appear as follows, see Figure 5 below:
The vertical line intersects the About right triangle at .4 and the Too fast
triangle at .3. This is determined by the ratio of sides of congruent triangles
from Plane Geometry:
8. The next step is to draw "effect" (output determining) triangles with their
height "h" determined by the values obtained in Step 7, above. The
triangles to be drawn are determined by the rules in Step 6. Since the
vertical 2,437.4 Rpm speed line does not intersect the Too slow triangle, we
do not draw the Speed up triangle. We draw the Not much change and the
Slow down triangles because the vertical speed line intersects the About
right and Too fast triangles. These "effect" triangles will be used to
determine controller output, that is the voltage to send to the speed control
DocumentToPDF trial version, to remove this mark, please register this software.
transistor. The result is affected by the widths we have given the triangles
and will be calculated. See Figure 6, below. The Not much change
triangle has a height of .4 and the Slow down triangle has a height of .3,
because these were the intersect points for their matching "cause" triangles;
see Figure 4, above.
The Area of the Not much change triangle is: 1/2 X Base X Height = .5 X
.04 X .4 = .008. Area of the Slow down triangle is .5 X .08 X .3 = .012.
Compute the controller output voltage by finding the point on the output
voltage, Vdc, axis where the "weight" (area) of the triangles will balance.
Assume all the weight of the Not much change triangle is at 2.40 Vdc and all
the weight of the Slow down triangle is at 2.36 Vdc. We are looking for the
balance point.
Find the position of the controller output voltage (the balance point) with the
following calculation:
The above system was tested with changing loads on the rotating shaft, and
returned the speed of the motor to within 2 % of the 2,420 Rpm set point in
less than 1.5 seconds. The accuracy with which the set point speed can be
maintained is determined by the resolution of the analog to digital and
digital to analog conversion circuits in the fuzzy logic controller. Typical
DocumentToPDF trial version, to remove this mark, please register this software.
"low cost" resolution is "8 bit", 256 increments. Higher cost "12 bit" units
provide 4,096 increments.
the control range, the better the control. Fortunately, most system control
problems can be solved with relatively few patches. A patch, or rule, may
be anything that solves the problem. If the system required it, you could
even mix continuous feedback loop control and off-on control over a
channel's control range, if that solved the problem.
4 . A p p lica t io n s
In this paper we have given the introduction of the fuzzy logic and
also the Advantages compared with the conventional control methods.
Mainly we have explained how the fuzzy control is different from the
Boolean logic. we have also given the applications of the fuzzy logic. In the
applications we have explained the speed control of DC motor by using
fuzzy logic.
7 . R ef eren ces
2. http://en.wikipedia.org/wiki/Fuzzy_set#Definition
3. http://www.seattlerobotics.org/encoder/mar98/fuz/flindex.html