Sei sulla pagina 1di 9

practically shows how a fuzzy logic

Fuzzy Logic Applied to approach can be applied to build a closed


Motor Control speed regulation loop from a very low cost
tacho-generator. Practical guidelines are
successively given from the initial concept
analysis phase, up to the final generation of
Authorised By the executable code to be loaded in the
SANTOSH BHARADWAJ REDDY microcontroller. The paper also gives the
Email: help@matlabcodes.com practical procedure to define the input
Engineeringpapers.blogspot.com parameters and to build fuzzy logic rules
when using the fuzzy logic development
More Papers and tool. Finally, the major benefits of this
Presentations available on paper lie in an original approach where
above site fuzzy logic is applied to fast “real-time”
regulation loop without requiring any
Abstract- specific expertise in conventional methods
Today, home appliance applications of regulation.
require more and more features such as
motor speed adaptations to multipurpose 1. INTRODUCTION
accessories, user-friendly interfaces, and
security features. Such new requirements Today in Europe, the trend in home
can be achieved through a low-end appliance is to have more and more features
microcontroller-based electronic control offering friendly use of and appliances
using the fuzzy logic approach. Now a days, minimizing energy consumption. Low-end
most of fuzzy logic-based controls are only micro controller associated to fuzzy logic
limited to a complicated ranking software are used inside different
management of user interfaces, sensors, equipment: for instance to optimize the
and actuators, corresponding to slow charge of batteries; to minimize water and
software speed operation. This paper energy consumption in washing machines;
proposes a totally different use of fuzzy to regulate temperature in air conditioning
logic. In this case, fuzzy logic is systems and refrigerators; and to manage
implemented in a standard micro controller the simple requirements of user interfaces,
to regulate the speed of a universal motor sensors, and actuators. These fuzzy logic-
by a real time adjustment (every 30ms) of based controls correspond to slow software
the motor current. This microcontroller speed operation. The block diagram for the
directly tunes the motor current by means of fuzzy logic associated with the process is
a chopper converter. Starting from a basic shown in fig.
food processor application, the paper
Fuzzy logic can be used in a very different
way: fuzzy logic software associated with a
standard low-end micro controller can
handle real time application and control the
speed of a universal motor by a real-time
The stator windings of such a motor are
adjustment of the motor voltage. To
connected in series with the rotor. The flux
perform this speed regulation, we need to
is proportional to the motor current and the
get some knowledge about the motor
motor torque is proportional to the square of
behavior, then, design and optimize the
the current. Therefore the motor speed is
regulation loop by using a fuzzy logic.
largely sensitive to torque variations as
Finally, we need to test the motor behavior
shown in Fig. 1. To keep the motor speed
with a food-processor.
stable upon load variations, bringing a more
comfortable use of the food processor and
2. WHY CONTROL MOTOR SPEED?
improving cooking mixture, control of
motor speed is now implemented in new
Most motors used in food-processors are
generations of food processors. To maintain
universal motors (brush motors with serial
the motor speed as the load varies, the
excitation). These motors can operate from
application must control the voltage applied
alternate current or from direct current.
to the motor by either “phase angle
modulation” techniques or “pulse width
modulation” (PWM) techniques.

3. PRACTICAL PPLICATION

Fig. 2 describes the topology of the motor


speed control application. The 400-W
universal motor of the food processor is
supplied in dc mode. This voltage is
adjusted using PWM techniques through a the A/D converter, i.e., 5 V). The tacho
chopper stage composed of an insulated generator signal is amplified, filtered and
gate bipolar transistor (IBGT) STGPlONSO then converted to a dc voltage by means of
and a freewheeling diode STTA806DI. A a simple frequency/voltage converter. This
standard microcontroller, the ST6265.With approach avoids timer and prescaler
its on-board PWM timer and A/D converter, programming changes and motor speed
measures the speed of the motor and drives calculation due to the large amplitude of the
the IGBT through a 5/15 V interface. In speed variations.
addition, the microcontroller manages tasks The speed measurement is done
such as minimum mains voltage detection, periodically and synchronized by an on-chip
tachogenerator voltage measurement, fuzzy timer acting as a time base. This time base
logic speed control, PWM duty cycle is defined taking into account the duration
generation, and motor speed selection. of the execution of the fuzzy rules. For the
A low-cost tachogenerator (made by a ST6 microcontroller family and for the
disk with teeth running in front of a number of rules and fuzzy variables defined
permanent magnet inside a coil) is available in this application, this duration is in the
in the food-processor to measure the motor range of 12 to 15 ms. However, to let the
speed. This speed can be measured by microcontroller concurrently manage other
means of the following:- tasks, such as motor speed selection and
the tachogenerator frequency and the transmitting the real time motor speed data
microcontroller timer; measurements, the duration of the
the tachogenerator voltage and the synchronization time base has been fixed to
microcontroller Analog to Digital 30 ms.
(A/D) converter.
A. Description of Food-Processor Motor
The universal motor used in this
application has a speed ranging up to 22000
r/min (i.e., 366 Hz). The gear ratio between
motor speed and accessory speed is equal to
7.5. The ratio between tachogenerator
frequency and motor frequency is equal to
16. One of the advantages of using fuzzy
logic for such an application is to overcome
the need for a precise mathematical model
of the system. Nevertheless, the system
behavior has to be known and this
One simple way to measure speed is to use knowledge can be acquired with some
the A/D converter (the maximum speed of simple experimental graphs. Open loop
the motor corresponding to the full scale of motor speed versus PWM duty cycle and
tachogenerator voltage versus motor speed
are shown in following Figs. 3 and 4. The
motor speed versus PWM duty cycle curve
gives the system sensitivity: 1% of PWM
duty cycle variation gives a speed variation
of 10 rotations per second for an unloaded
motor at low speed, 2.5 rotations per second
for a loaded motor. The tachogenerator
voltage versus motor speed curve gives the
system resolution. Maximum speed of
motor being coded by the 8-bit A/D
converter, the speed measurement
resolution is 3 rotations per second.

B. Input/Output Variables Definition The output variable is the PWM duty cycle
The input variables of the fuzzy logic variation, ∆δ, calculated by the fuzzy
controller, estimating the motor speed inference kernel. The PWM duty cycle is
variations, are the speed error € and the then calculated by the microcontroller:
speed error variations ∆€: ∆δ %( n) =∆δ %( n - 1) + ∆δ and
―The speed error € equals the measured applied to the IGBT gate each 30ms, fine
speed minus the targeted speed tuning the motor speed. This PWM output
€ = V tacho − V. Its range of variation is signal, automatically generated by the
defined by the maximum speed of motor, micro-controller PWM timer, ranges from
i.e., [-300 Hz, +300 Hz]. 0% to 100% with a resolution of 0.4% (full
―The speed error variation ∆€, estimating range of the PWM duty cycle is coded from
the motor speed evolution, equals, at 0 to 255).
sampling time (30 ms), measured speed
minus previously measured speed, IV. FUZZYL OGIC A PPROACH
∆€= V tacho (n) − V tacho (n - 1).
The fuzzy logic approach is used to
develop this application covers all the steps
of a fuzzy logic design from the definition
of the project, of the linguistic variables and
of the rules. Furthermore, this tool generates
the executable code for the ST6
microcontroller. Fig. 6, giving the program
flow chart, shows a fuzzy logic
development can be divided in two main
parts:
The microcontroller environment program range is well covered with five membership
and the fuzzy logic application itself. functions. According to the sensibility of
−The environment program consists of the speed measurement line and to the speed
microcontroller initialization, motor sampling rate, (3 rotations/s each 30 ms
speed acquisition, calculation of speed corresponds to an acceleration of 100
error and speed error variation, input rotations/s), the motor speed variation range
variable adaptation to fuzzy logic is described with three membership
kernel code values, fuzzy logic kernel functions. The triangular shaped (“Pi-
calling, PWM duty cycle update, Type”) membership functions “Zero” and
acquisition of new motor speed “Null” make the PWM duty cycle variations
command, and end of synchronization less sensitive to the A/D converter
time base waiting. resolution.
−The fuzzy logic part consists of ST6 During the definition of linguistic
executable code generated by the variables, the development tool allows the
development tool. This part is made of user to define two representations for the
the fuzzification of the input variables, variables: the “shell value” and the “code
execution of the activated rules, and value.” The shell values are the real-word
defuzzification producing the output value that the variables represent. They are
variable. only used to display actual data with the
tool. The code values are the 8-bit internal
values that the microcontroller uses to
A. Project Definition calculate results and range from 0 to 255 (8-
The first step when using the fuzzy logic is bit representation). Having the same scale
to define the structure of the controller. Fig. for the code value and the shell value gives
7displays the controller structure and allows a better understanding of the control
the designer to directly access linguistic behavior by directly comparing the real
variables and rule definitions. fuzzy input/output to the linguistic
variables.
B. Linguistic Variables Definition
The next step of the controller design is the
definition of linguistic variables. The
graphic interface of the development tool
allows the designer to easily create the most
suitable linguistic variables and the
membership functions for the application.
The input membership functions shown in
Fig. 8 are defined taking into account the
speed and the acceleration of the motor and
the system resolution. The motor speed
Working with variations of input variables,
which can have negative values, an
adaptation of real variables to fuzzy kernel
input has to be done to code the whole
range of the input variables within the range
[0, 255].The motor speed representation
(given by the A/D converter) can vary
from 0 to 255, so the speed error and the
speed error variation range from -255 to
+255. This variation is coded within the
range [0,255] by dividing by 2 the input
variables and adding 127 (07Fh) to
normalize the value. As the PWM duty
cycle variation is computed using the centre
of gravity method, the output linguistic
variable can be represented with lines
instead of the triangular shape as shown in
Fig. 9. The PWM Var code value has been
reduced to the range [0, 24] producing each
30 ms a maximum duty cycle variation of
C. Rule Definition
Fig. 10 shows the fuzzy controller rules.
They have been defined by the
understanding of the behavior of the system.
One can find rules maintaining speed error
near zero (steady state rules), rules that
avoid motor speed overshoot and rules that
provide rapid response to large error
resulting from command change. Fig. 10
shows the fuzzy controller rules. They have
been defined by the understanding of the
behavior of the system and one can find
rules maintaining speed error near zero
(steady-state rules); rules avoiding motor
speed overshoot and rules providing rapid
response to large error due to command
change. The fuzzy development tool with its
spreadsheet rule editor (Fig. 10) offers an
+ 5% with a resolution of 0.4% directly easy way to examine and define the suite of
compatible with the PWM resolution rules. It also permits the definition of rule
generated by the ST6. This avoids aggregation (MIN and MAX operators are
additional calculation when adding the available) and rule composition (PROD
PWM duty cycle variation + ∆δ (%) to the operator with degree of support of 0 or 1).
current PWM duty cycle δ (%). For the food-processor motor, the suite of
rules uses the min operator to smooth the
reactions of the output variable when the variations of the output variable are
application executes several rules. The consistent with the system.
degree of support for all rules has been Optimizing the system behavior is easily
fixed to 1. and quickly achieved by using the
development tool associated with the real-
D. System Behavior Optimization time test:
The fuzzy development tool provides off- −Changing the regulation algorithm is
line mechanisms to debug, test, and achieved by changing the set of rules.
optimize the rules and membership function −Tuning the system behavior is
definition in open loop: achieved by modifying the
-The interactive debug mode offers a membership function definition.
graphical verification of every design Then the executable code for the
step even while the design is being microcontroller is automatically generated
performed. by the tool.
-The batch mode associated with a
pattern generator records the output V. PRACTICAL RESULTS
variables versus each of the input
variables for testing and evaluating the Recordings of tachogenerator voltage
design performance. (corresponding to the motor speed) and
PWM duty cycles while the motor is
∆€ −> NS NULL PS running are given in the following figures.
€ Fig. 11 shows the speed step response when
down) the motor is not loaded. (Corresponding to
NB PB PB PM the motor speed) and PW speed in 1.3 s
corresponding to the execution of about 40
NS PM PM PM fuzzy logic loops. No overshoot of the
motor speed has been observed. In steady
ZERO PM ZERO NM state, we can notice motor speed
fluctuations of +3rotations/s. These fast
PS ZERO NM NM fluctuations (30 ms) are due to the
resolution limit of the speed measurement
PB NM NB NB line (tacho generator and A/D converter)
and remain inaudible.
Fig. 12 shows the load step response of the
Fig 10.Fuzzy inference rule table
motor. The motor is permanently loaded
with 200-W, 40-W, and 110-W load
Using these features, designer can verify
variations are applied. Upon these load
that all the defined rules are necessary, that
variations, the motor recovered the targeted
no important rules are missing and that the
speed within less than 1s without any speed logic has avoided needing the knowledge of
overshoot. a precise mathematical model of the
regulation loop system. Associated with the
fuzzy logic development tool, fuzzy logic
allows a designer to develop, test, and
optimize a regulation loop quickly: this
motor control has been done in few weeks.
In addition to a food-processor, this motor
control, implemented using a ST6265
microcontroller running a fuzzy logic
software, gives good results for home
appliances such as drills and washing
machines. Improvements can be achieved
by increasing the sensitivity of the speed
error variation or by adding a 3rd parameter
giving an image of the motor load to adapt
the PWM variation to the motor speed.
Adapting this application to a universal
motor driven in ac mode with a triac can be
easily done by only changing the fuzzy
logic output variable.

REFERENCES

[1] George J.klir and Tina A.folger, “Fuzzy


Sets, uncertainity, and information”.
[2] John Yen Rezalangari, “Fuzzy logic:
. Intelligence, control and information”.
[3] H-J.Zimmermann, Fuzzy Set Theory-
VI. CONCLUSION and it’s Applications, 2nd rev
ed.Dordrecht-Boston: Kluwer.
Starting from a basic food-processor
application, the paper describes how a fuzzy
logic approach is especially powerful in a
home appliance to help a designer having an
analog background or without regulation
techniques background to develop a
microcontroller-based control. Using fuzzy

Potrebbero piacerti anche