1. PROJECT DEVELOPEMENT
FUZZY SYSTEM
• Creating membership function using MATLAB
application.
• 4 input membership function.
• 1 output membership function.
• Defuzzification using MAMDANI style.
2. Cont. ……
• Create rule evaluation.
• Choose more usable rule for our traffic light
system.
• Do try and error to find rule that give more
logic condition.
• Cut any rule that give same result.
Testing fuzzy system using MATLAB to check
condition of our system before implement in PLC.
8. Evaluation of RULE
Use MAMDANI style.
Use min-max.
Difuzzification using centroid of gravity.
On our project we have use 45 rules to
make our system function properly.
9. Creating Fuzzy using Cx-Process
Tool
Create fuzzy block diagram.
Because our output for fuzzy is four, so
we need to construct four fuzzy block
diagram.
Create user link table to read/write
(communicate) between LCB (Cx-
Process) and CPU PLC (Cx-Programmer).
10. Cont.
Need to create input MF, up to 8 input. (but
in our project we just use 4 input; X1, X2,
X3, X4.)
Input membership variable:
NL: 0:2500
NS: 0:2500:5000
ZR: 2500:5000:7500
PS: 5000:7500:10000
PL: 7500:10000
11. Cont.
Need to create output MF, up to 2 output;
Y1 and Y2.
But, in our project just use 1 output; Y1.
Use horizontal singleton.
Output membership variable:
NL: 5000
NS: 10000
ZR: 15000
PS: 20000
PL: 25000
12. Cont.
RULES
Rules express experience and know-how in IF-
THEN statements. For example, IF (you're close
to the car in front of you) & (you're going very
fast) THEN (you have to step on the brake very
hard).
Up to 64 rules.
In our project using 45 rules.
Up to 8 conditions can be set for inputs X1 to
X8, and up to two conclusions can be set for
outputs Y1 and Y2.
13. Cont.
Conditions
The labels that will be used for inputs X1 to
X8 are listed in order separated by colons.
For example, if label NS is used for input
X1 and labels ZR, PL, PL, NS, ZR, PL, and
PL are likewise used for inputs
X2, X3, X4, X5, X6, X7, and X8, then
NS:ZR:PL:PL:NS:ZR:PL:PL is specified.
14. Cont.
Conclusions
The labels that will be used for outputs Y1 and
Y2 are listed in order separated by colons.
For example, if ZR is used for output Y1 and PL
is used for output Y2, then ZR:PL is specified
A slash is placed between the conditions and
conclusions.
For example, the above rule would be specified
as follows:
NS:ZR:PL:PL:NS:ZR:PL:PL/ZR:PL
15. Cont.
Set a hyphen for inputs or outputs for which
labels are not set.
For example, to set NL for input X1, PL for
input X2, and ZR for output Y1, then the
rule "IF (Input X1 is NL and Input X2 is PL),
THEN (Output Y1 is ZR)" would be
specified as follows for ITEM 101:
NL:PL:-:-:-:-:-:-/ZR:-
18. Creating ladder diagram (cx-
programmer)
used to create ladder diagram for input and output
of traffic light system.
Use a discrete sensor (photoelectric switch) to
detect presence vehicle for each junction.
Use counter in ladder to count vehicle which detect
by photoelectric switch.
Data from counter is transform to LCB (Fuzzy
system) to process by fuzzy system.
Data from LCB then send to PLC to generate
output for traffic light.
Data from LCB is Hex, so it must create a ladder
diagram to make is useful for generate timer for
traffic light system.
19. Testing & Result
Using MATLAB
Guide to test using Matlab:
Put number of vehicles for each junction at bottom pages and
look for output at top right pages.
Put number of
vehicles here
22. Testing in real system (PLC
with Fuzzy system)
Guide to testing;
The car come from each junction with
random number.
The car must past the first sensor and stop
before the second sensor.
When traffic light going to green, car at the
junction with green lamp will move until
past the second sensor.