Fuzzy Def
Fuzzy Def
Fuzzy Def
Brock J. LaMeres
Montana State University
Bozeman, MT 59717
[email protected]
I. INTRODUCTION
Another advantage of using a fuzzy logic control A three-phase, 5kVA laboratory-size alternator,
strategy is that it allows a model-free estimation of the running at rated speed and rated armature voltage
system. In other words, the designer does not need to experiences a varying 3-phase load. As the armature
state how the outputs depend mathematically upon the voltage fluctuates with the changing load, the
inputs. A fuzzy controller can be developed by excitation current into the field of the generator must
encoding the structured knowledge of the system. be altered to bring the armature voltage back to its
This allows faster control algorithms to be developed rated value. This is accomplished with an intelligent
in less time and at less cost. With the advance of control strategy programmed into a Texas Instruments
microprocessors and Digital Signal Processor’s TMS320C5x DSP. The line to line voltage of the
(DSP’s), fuzzy logic control devices are becoming a alternator will be fed into a ‘step down and isolation’
more attractive solution for real time control situations (20/1) stage which will produce a signal that is
[1]. suitable for the DSP (i.e., 0-10 volts). This signal will
first be converted from analog to digital using an
1
onboard 12-bit signed A/D converter. The DSP will tell the controller if the voltage needs to be
compare the immediate armature voltage (Va) to its raised/lowered or if the machine is operating at its
rated voltage (Vref) to find the voltage error (e) that rated voltage. The input voltage is the phase voltage
exists. of the alternator stepped down with a ratio of 20 to 1.
This ‘step down’ stage will produce a signal that is
suitable for the DSP (< 10 Vp). For the generator in
this experiment, the rated voltage of 120 VRMS is
stepped down to a voltage of +/- 8.5 Vp.
It will then find the rate of change of voltage by
comparing the previous voltage value to the The second input to the controller is the rate of change
immediate armature voltage. These two inputs will be of voltage. This input describes how fast the output
evaluated using a fuzzy logic-based control algorithm voltage is changing. This is an important factor in a
and an output signal will be produced. The digital real time control strategy for increasing the time
output signal will then be fed into a 12 bit D/A response of the system. For example, the voltage may
converter giving an analog signal out ranging from 0 – be 2 volts lower than its rated voltage. In one case the
10 volts. This signal will be proportional to the field output voltage is static and a slight increase in field
current that is to be applied to the field of the current will bring the generator back to its rated
alternator (i.e., 5 volts => 1.5 Amps). This is then fed voltage. In another case, the output voltage may still
into an isolation amplifier. This amplifier is an opto- be 2 volts lower but decreasing rapidly. For this
coupler that will provide additional isolation and situation a larger field current must be applied (at least
safety. The signal is then fed to a power amplifier that temporarily) in order to bring the generator back into
will produce the necessary field current in order to control.
regulate the armature voltage (i.e., 0 – 3 amps).
The output of the fuzzy logic controller is the field
III. THE FUZZY LOGIC CONTROLLER current. A proportional voltage from the DSP will be
output into an isolation amplifier and then to a power
Fuzzy logic control is a non-mathematical decision amplifier that will provide 0-3 amps (If = 1.5 ARATED)
algorithm that is based on an operator’s experience. to the field of the alternator. This signal will increase
This type of control strategy is suited well for non- or decrease the current to the field of the synchronous
linear systems such as the synchronous generator, generator in order to regulate the output voltage. This
which exhibits non-linearity between the field current can be seen if figure 1. Figure 3 shows the variables
in and the armature voltage out [3]. Figure 2 shows of the fuzzy logic controller.
the no-load saturation curve of the 5kVA, laboratory
size synchronous generator to be controlled. As
shown, the curve behaves in a non-linear fashion as it
enters its saturation region at If = 3.3 amps. The Voltage
fuzzy logic controller can easily be programmed to Input #1
handle this region.
Fuzzy Logic Field Current
Controller Output #1
Phase Voltage (volts)
200
(49 Rules)
150 Rate of Change
of
100 Voltage
Input #2
50
0
0 1 2 3 4 5
Figure 3. Variables of the Fuzzy Logic Controller
Field Current (A)
2
Rule Base The inputs are mapped into these membership
functions and a degree of membership is found for
Ref e
Signal +
how much the input belongs to that particular
Inference
del e
Fuzzifier
Engine
Defuzzifier linguistic label. The membership can take on a value
- from zero to unity for each of the linguistic labels.
Feedback The waveforms are evenly distributed about the range
Signal
of operation of the variables. For each of the input
and output variables, the following seven linguistic
Figure 4. Structure of Fuzzy Logic Controller labels are assigned to the membership functions:
NL = Negative Large
FUZZIFIER NM = Negative Medium
NS = Negative Small
Fuzzy logic uses linguistic variables instead of ZE = Zero
numerical variables. In a closed loop control system, PS = Positive Small
the error (e) between the reference voltage and the PM = Positive Medium
output voltage and the rate of change of error (del e) PL = Positive Large
can be labeled as zero (ZE), positive small (PS),
negative small (NS), etc. In the real world, measured Once the membership is found for each of the
quantities are real numbers (crisp). The process of linguistic labels, an intelligent decision can be made
converting a numerical variable (real number) into a unto what the output should be. This decision process
linguistic label (fuzzy number) is called fuzzification. is called inference.
Figure 5 shows the membership functions that are used
to fuzzify the inputs. INFERENCE
3
The rules of a fuzzy logic controller give the membership function’s center and height, divided by
controller its intelligence, assuming the rules are the sum of all the membership functions’ heights [4].
developed by a person who has a experience with the
Z1 ⋅ h1 + Z 2 ⋅ h2 + ⋅ ⋅ ⋅ + Z n ⋅ hn
system to be controlled. A programmer with more
ZO =
experience with the system will create a better
controller.
h1 + h2 + ⋅ ⋅ ⋅ + hn
Figure 7 & 8 shows the graphical representation of
In the case of the fuzzy logic synchronous generator this method.
controller, the desired effect is to keep the output
voltage of the generator at its rated voltage under
varying loads. From this desired goal, rules are made
for every combination of voltage and rate of change of
voltage on what the field current should be in order to
stabilize the generator. It is convenient when dealing
with a large number of combinations of inputs, to put
the rules in the form of a rule table. Figure 6 shows
the rule table for controlling the synchronous
generator output voltage where Del Volt refers to the
rate of change of output voltage. Figure 7. Weighted Average
Defuzzification Method (1)
Voltage
NL NM NS ZE PS PM PL
NL PL PL PL PL PM PS ZE
NM PL PL PM PM PS ZE NS
Del NS PL PM PS PS NS NM NL
Volt ZE PL PM PS ZE NS NM NL
PS PL PM PS NS NS NM NL
PM PM ZE NS NM NM NL NL
PL ZE NS NM NL NL NL NL Figure 8. Weighted Average
Defuzzification Method (2)
Figure 6. Fuzzy Logic Rule Table
After the rules are evaluated, each output membership This method was chosen primarily for its speed. The
function will contain a corresponding membership. crisp value that it produces is fairly easy to calculate
From these memberships, a numerical (crisp) value computationally. The output also reflects the
must be produced. This process is called membership of each contributing membership
defuzzification. function. Also the value depends on the shape of the
waveform. The output will not move as smoothly
DEFUZZIFICATION from value to value as it would have if a more
complicated defuzzification method was chosen, but
Defuzzification plays a great role in a fuzzy logic- the speed advantages outweigh the small gain in
based control system. It is the process in which the accuracy in a real time control situation where time
fuzzy quantities defined over the output membership response is a concern.
functions are mapped into a non-fuzzy (crisp) number.
It is impossible to convert a fuzzy set into a numeric
value without loosing some information. Many IV. IMPLEMENTATION
different methods exist to accomplish defuzzification.
Naturally there are trade-offs to each method. The implementation of this closed loop control
strategy has many parts. The ultimate goal is to
The method that was chosen for implementation in increase/decrease the field current of a synchronous
this project was the Weighted Average method. This generator to raise/lower the output voltage to its rated
method is defined as the sum of the products of each value. The output voltage of the generator must be
4
stepped down to a level that is suitable for the DSP, difference between Vcurrent and Vprevious gave the
i.e. 0 – 10 volts. The generator is assumed to be at necessary information on the rate of change of the
constant 60 Hz with a balanced three-phase load. voltage. The membership functions for rate of
With this assumption, it is necessary to monitor only change of voltage were scaled to accommodate this
one phase of the output voltage. This signal is alteration. The rate of change that was implemented
converted into a digital signal by going through an was:
Analog to Digital (A/D) converter and fed to the DSP dV
where the fuzzy logic decision will be made to ≡ Vcurrent − V previous
determine the amount of field current needed. This dt
digital value will then be converted to an analog signal Once the fuzzy logic decision has been made
(D/A). The analog signal will be fed to the isolation according to the two inputs, the D/A converter would
and power amplifiers that will in turn change the value turn the output into an analog signal that could be fed
of the field current to maintain a constant output to the power amplifier. The power amplifier would
voltage at the synchronous generator terminals. The step up the output signal generator field current
experimental setup of this real time procedure is given accordingly.
below.
The isolation amplifier used was a Burr-Brown opto-
EXPERIMENTAL SETUP coupling device that provided additional isolation and
safety.
The main piece of hardware that was used in this
design was the DSP. The components that were used The power amplifier portion of the system was
on it were the 12.5 µs/12-bit A/D converter, the 12-bit implemented with a Dayton, Motor Control Power
D/A converter, the timer, and the 40 MHz, 32-bit Amplifier. This device was driven by a 0-10 VDC
processor. signal and would produce a 0 – 3 Amp signal that was
fed to the field of the synchronous generator
The synchronous generator that was controlled in this
design was a General Electric, 5kVA, three phase, Figure 9 shows the laboratory setup for the
1800 rpm, 120 Vrms machine. The field current was implementation of the fuzzy logic controller.
rated at 1.5 Amps.
5
All the code for the DSP was written in the TI C5x’s EXPERIMENTAL RESULTS
assembly language. The assembly language was then
examined and optimized for faster time performance. The controller was tested under four different types of
loads, a light resistive load (20%), a heavy resistive
The fist step in this program was to initialize the load (85%), a capacitive, and an inductive load. In all
processor, program memory, A/D, D/A, and timers. cases the fuzzy logic controller was able to bring the
The main program begins by reading from the A/D output voltage of the generator back to its rated
100 times per 60 Hz cycle. These values are voltage. Figures 10 shows the armature voltage of the
evaluated and the largest value is selected as the peak generator as a sudden resistive load is applied. Figure
voltage. This peak voltage is the first input to the 11 shows the voltage that the controller applies to the
controller (voltage). The next stage of the program field in order to bring the generator back to its rated
was to find the rate of change of voltage. Each time voltage.
through the program, the current voltage is compared
against the previous voltage. This difference is the
rate of change of voltage and is the second input to the
controller. After the two inputs are found, the main
fuzzy logic decision algorithm is executed to find the
appropriate output value. Once this occurs, the value
is output through the D/A converter and held until the
next output value is ready. This process is repeated
indefinitely. Figure 9 shows the flow chart for the
fuzzy logic-based controller implemented on the DSP.
Figure 11. Armature Voltage Under a Light Resistive
Start Load (20%).
Initialize
DSP
Input Voltage
Through A/D
Loop
100x
Apply Fuzzy
Logic Control
Algorithm
Output Value
6
Figure 14. Field Voltage Applied under a Heavy
Figure 18. Field Voltage Applied under an Inductive
Resistive Load (85%).
Load.
V. CONCLUSION
7
and performed a fuzzy logic control algorithm on the
input and the rate of change of input. After the output
signal was calculated, it was fed to a D/A converter to
produce an analog signal. This signal was then fed to
the isolation and power amplifiers. The isolation
amplifier provided additional isolation and safety.
The power amplifier provided the necessary current to
the field of the generator in order to keep the
generator’s output voltage at its rated value.
REFERENCES