Professional Documents
Culture Documents
Fuzzy
Fuzzy
Fuzzy
Abstract:
This project paper describes the design of a room temperature controller using fuzzy logic. The
proposed model consists of fuzzy logic controllers to control temperature. The controller accepts
two input values- the current temperature as detected by temperature sensor and its deviation
from user set-temperature, and controls the speed of heat-fan and cool-fan accordingly. This
research work will increase the capability of fuzzy logic control systems in process automation
with potential benefits. MATLAB-simulation is used to achieve the designed goal.
1 Introduction
This proposed design work of room temperature controller can be used in a processing plant to
maintain comfortable atmosphere in the room the basic model of the proposed structure consists
of room temperature controller with fuzzy logic control system. The room atmosphere controller
has a heating fan, a cooling fan to heat or cool the room according to user demand; temperature
sensors used to monitor the environment of room are mounted in the room and are connected
with the fuzzifiers of the fuzzy logic control system.
2.An inference mechanism (also called an “inference engine” or “fuzzy inference” module),
which emulates the expert’s decision making in interpreting and applying knowledge about how best to
control the plant.
3.A fuzzification interface, which converts controller inputs into information that the inference
mechanism can easily use to activate and apply rules.
4.A defuzzification interface, which converts the conclusions of the inference mechanism into
actual inputs for the process
e(t)
FLC Y(t)
Heater fan Plant
Cooler fan
Ce(t)
It is the current temperature of the room as recorded by the temperature sensor mounted
in the room
It gives the difference between the user preferred temperature and current temperature of
the room as recorded by the temperature sensor in the room
Output Variables
1.Heat-Fan-Speed
The heat fan can either be in ON or OFF state depending on the temperature preference in the
room
2.Cool-Fan-Speed
The cool fan can either be in ON or OFF state depending on the temperature preference in the
room
HOT 29-37
VERY-HOT 36-44
Linguistic values for Deviation Current Temperature are negative large(NL), negative
small(NS), zero(Z), positive small(PS) and positive large(PL).
As this model can work between temperature range 8-44’C and user can set any desired
temperature from 18-26’C, so temperature difference between the current and the user
preferred temperature can never go beyond -26’C (18’C – 44’C) and 18’C (26’C - 8’C).
Thus (-26’C) & (+18’C) are the lower and upper limits of the input variable “ deviation
from set-temperature”).
MEMBERSHIP RANGE(oC)
FUNCTIONS
NL -26 to -12
NS -13 to 0
O -2 to 2
PS 1 to 10
PL 9 to 18
MEMBERS RANGE %
HIP
FUNCTION
S
STOP 0-5
HEAT- 0-30
SLOW
HEAT- 25-50
MEDIUM
FAST 45-80
very-FAST 75-100
MEMBERSHIP RANGE %
FUNCTIONS
STOP 0-5
COOL-SLOW 0-30
COOL-MEDIUM 25-50
COOL-FAST 45-80
COOL-V.FAST 75-100
Form rule based on the input and output variables to control speed of heat fan and
cool fan.
4 Rule generate
Rules that relate input and output variables for fuzzy controllers:
1. If (input1 is VC) and (input2 is NL) then (output1 is STOP) and (output2 is STOP)
2. If (input1 is VC) and (input2 is NS) then (output1 is HS) and (output2 is STOP)
3. If (input1 is VC) and (input2 is ZERO) then (output1 is HM) and (output2 is STOP)
4. If (input1 is VC) and (input2 is PS) then (output1 is HF) and (output2 is STOP)
5. If (input1 is VC) and (input2 is PL) then (output1 is HVF) and (output2 is STOP)
6. If (input1 is C) and (input2 is NL) then (output1 is STOP) and (output2 is CS)
7. If (input1 is C) and (input2 is NS) then (output1 is STOP) and (output2 is STOP)
8. If (input1 is C) and (input2 is ZERO) then (output1 is HS) and (output2 is STOP)
9. If (input1 is C) and (input2 is PS) then (output1 is HM) and (output2 is STOP)
10. If (input1 is C) and (input2 is PL) then (output1 is HF) and (output2 is STOP)
11. If (input1 is N) and (input2 is NL) then (output1 is STOP) and (output2 is CF)
12. If (input1 is N) and (input2 is NS) then (output1 is STOP) and (output2 is CM)
13. If (input1 is N) and (input2 is ZERO) then (output1 is STOP) and (output2 is STOP)
14. If (input1 is N) and (input2 is PS) then (output1 is HM) and (output2 is STOP)
15. If (input1 is N) and (input2 is PL) then (output1 is HF) and (output2 is STOP)
16. If (input1 is H) and (input2 is NL) then (output1 is STOP) and (output2 is CVF)
17. If (input1 is H) and (input2 is NS) then (output1 is STOP) and (output2 is CF)
18. If (input1 is H) and (input2 is ZERO) then (output1 is STOP) and (output2 is CM)
19. If (input1 is H) and (input2 is PS) then (output1 is STOP) and (output2 is STOP)
20. If (input1 is H) and (input2 is PL) then (output1 is HS) and (output2 is STOP)
21. If (input1 is VH) and (input2 is NL) then (output1 is STOP) and (output2 is CVF)
22. If (input1 is VH) and (input2 is NS) then (output1 is STOP) and (output2 is CF)
23. If (input1 is VH) and (input2 is ZERO) then (output1 is STOP) and (output2 is CM)
24. If (input1 is VH) and (input2 is PS) then (output1 is STOP) and (output2 is CS)
25. If (input1 is VH) and (input2 is PL) then (output1 is STOP) and (output2 is STOP)
NB
Output 1= Heat-Fan-speed
Output 2= cool-Fan-speed
Where
C= cool temperature
N= normal temperature
H=hot temperature
Where
NL=the Deviation Current Temperature is very hot or negative large
NS=the Deviation Current Temperature hot or negative small
Zero=the Deviation Current Temperature is normal or zero
PS= the Deviation Current Temperature is cool or positive small
Where
Where
To find the crisp value first determines one appropriate rule from 25 rules.
A crisp set of input data are gathered and converted to a fuzzy set using fuzzy linguistic
variables.
The rule selected for inference process is:
Figure shows the membership functions for the inputs and indicates with thick black vertical
lines the values above for e(t) and de(t)dt.
Notice that μvcool(e(t)) = 0.0625 and μcool(e(t)) = 0.1875 but that the other membership
functions for the e(t) input are all “off” (i.e., their values are zero). For the 𝑑(𝑡)𝑑𝑡 input we see
that μ𝒑𝒐𝒔large (𝑑𝑒(𝑡)𝑑𝑡) = 0.75 and that all the other membership functions are off.
This implies that rules that have the premise terms: “error is very cool”
“error is cool”
“change-in-error is poslarge” are on (all other rules have μ𝒑𝒓𝒆𝒎𝒊𝒔𝒆 (e(t), 𝑑𝑒(𝑡)𝑑𝑡) = 0.
Rule 1 If (input1 is VCool) and (input2 is PL) then (output1 is HVF)(output2 is STOP)
Rule2 If (input1 is Cool) and (input2 is PL) then (output1 is HF)(output2 is STOP)
E(t)=[8 12 16]
Select e(t)=15.75 on
the Deviation Current Temperature Ce(t )is very cool or positive large member ship function
Ce(e)=[9 13.5 18]
Select Ce(t)=12.375
μ vc e(t)=0.0625 this value is the membership function at e(t)=15.75 on and the other
membership functions for e(t) input are all zero(off).
μ pl Ce(t)=0.75this value is the membership function at Ce(t)=12.375 on and the other
membership functions for Ce(t) input are all zero(off).
Fig Membership function for Deviation Current Temperature is very cool or positive large
Determine which rule is on from the given membership function of the above premise terms
Current Temperature e(t) is cool member ship function
E(t)=[15 19 23]
Select e(t)=15.75
the Deviation Current Temperature Ce(t )is very cool or positive large member ship function
Ce(e)=[9 13.5 18]
Select Ce(t)=12.375
μ c e(t)=0.1875 this value is the membership function at e(t)=15.75on and the other membership
functions for e(t) input are all zero(off).
μ pl Ce(t)=0.75 this value is the membership function at Ce(t)=12.375 on and the other
membership functions for Ce(t) input are all zero(off).
Implication
Membership function for consequence terms
i.e
Figure speed of heat-fan output( consequent )membership function for rule (1)
=0.046875
Figure speed of cool-fan output( consequent )membership function for rule (1)
i.e
Figure speed of heat-fan output( consequent )membership function for rule (2)
Figure speed of heat-fan output( consequent )membership function for rule (2)
8 Aggregation
Fuzzy Logic provides a number of functions for aggregating two or more fuzzy sets or fuzzy relations.
When using the aggregation operations, the fuzzy sets or fuzzy relations being combined must be defined
on the same universal space. It does not make sense to combine items defined on different universal
spaces. In this project we use sum for aggregation for the implied fuzzy sets.
10 Deffuzification
It the processes of converting output of inference mechanism into crisp value (numerical
value) .It operate based on implied fuzzy set to provide the most certain controller output.
There are two possible rules:
2 center average.
Ucrisp = (87.5*0.046875+62.5*0.140625)/(0.046875+0.140625)
Ucrisp= (2.5*0.046875+2.5*0.140625)/(0.046875+0.140625)