Anda di halaman 1dari 9

zerokol.com: eFLL - A Fuzzy Library for Arduino and Embeded Systems http://www.zerokol.com/2012/09/arduinofuzzy-fuzzy-library-for-arduino...

zerokol.com
Vamos que vamos, ao infinito e alm!

Incio Android Arduino Hack Node.JS Rails Ubuntu

eFLL - A Fuzzy Library for Arduino and Embeded Systems

Leia este artigo em Portugus

Fuzzy Logic is an extension of traditional Boolean logic, using linguistic variables allows to express logical values
intermediate between FALSE and TRUE, describing with greater efficiency the uncertainty principle in the real world.

Fuzzy Systems are practical applications that employ Fuzzy Logic in its decisions making on the basis of linguistic
variables and terms, the robotics and the electronic engineering has a large utility room.

Developed by Robotic Research Group (RRG) at the State University of Piau (UESPI-Teresina) the eFLL
(Embedded Fuzzy Logic Library) library is a versatile, lightweight and efficient option to work with Fuzzy Logic in
embedded systems.

Please, report bugs and suggestions with comments or in the official code page on GitHub

How to install

Step 1: Go to the official project page on GitHub: eFLL

Step 2: Make a clone of the project using Git or download it Donwload on the button "Download as zip."

Step 3: Clone or unzip the files into Arduino libraries' folder:

Obs: Rename the folder from "eFLL-master" to "eFLL"

Ubuntu (/usr/share/arduino/libraries/) if installed via apt-get, if not, on Windows, Mac or Linux (where you downloaded the
Arduino IDE, the Library folder is inside)

Ok! The library is ready to be used.

How to import

If the installation of the library has been successfully held, to import the library is easy:

Step 1: Open your Arduino IDE, check out the tab on the top menu SKETCKS LIBRARY Import eFLL

Caractersticas

Written in C++/C, uses only standard C language library "stdlib.h", so eFLL is a library designed not only to Arduino, but
any Embedded System or not how have your commands written in C.

It has no explicit limitations on quantity of Fuzzy, Fuzzy Rules, Inputs or Outputs, these limited processing power and
storage of each microcontroller

1 de 9 02-08-2016 21:34
zerokol.com: eFLL - A Fuzzy Library for Arduino and Embeded Systems http://www.zerokol.com/2012/09/arduinofuzzy-fuzzy-library-for-arduino...

The library uses the process:

MAX-MIN) and (Minimum Mamdani) for inference and composition and (CENTER OF AREA) to defuzzification in a
continuous universe.

Tested with GTest for C, Google Inc.

Simple example:

Speed control of a robotic, entry: Frontal distance obstacle.

1 #include <FuzzyRule.h>
2 #include <FuzzyComposition.h>
3 #include <Fuzzy.h>
4 #include <FuzzyRuleConsequent.h>
5 #include <FuzzyOutput.h>
6 #include <FuzzyInput.h>
7 #include <FuzzyIO.h>
8 #include <FuzzySet.h>
9 #include <FuzzyRuleAntecedent.h>
10
11 // Step 1 - Instantiating an object library
12 Fuzzy* fuzzy = new Fuzzy();
13
14 void setup(){
15 Serial.begin(9600);
16
17 // Step 2 - Creating a FuzzyInput distance
18 FuzzyInput* distance = new FuzzyInput(1);// With its ID in param
19
20 // Creating the FuzzySet to compond FuzzyInput distance
21 FuzzySet* small = new FuzzySet(0, 20, 20, 40); // Small distance
22 distance->addFuzzySet(small); // Add FuzzySet small to distance
23 FuzzySet* safe = new FuzzySet(30, 50, 50, 70); // Safe distance
24 distance->addFuzzySet(safe); // Add FuzzySet safe to distance
25 FuzzySet* big = new FuzzySet(60, 80, 80, 80); // Big distance
26 distance->addFuzzySet(big); // Add FuzzySet big to distance
27
28 fuzzy->addFuzzyInput(distance); // Add FuzzyInput to Fuzzy object
29
30 // Passo 3 - Creating FuzzyOutput velocity
31 FuzzyOutput* velocity = new FuzzyOutput(1);// With its ID in param
32
33 // Creating FuzzySet to compond FuzzyOutput velocity
34 FuzzySet* slow = new FuzzySet(0, 10, 10, 20); // Slow velocity
35 velocity->addFuzzySet(slow); // Add FuzzySet slow to velocity
36 FuzzySet* average = new FuzzySet(10, 20, 30, 40); // Average velocity
37 velocity->addFuzzySet(average); // Add FuzzySet average to velocity
38 FuzzySet* fast = new FuzzySet(30, 40, 40, 50); // Fast velocity
39 velocity->addFuzzySet(fast); // Add FuzzySet fast to velocity
40
41 fuzzy->addFuzzyOutput(velocity); // Add FuzzyOutput to Fuzzy object
42
43 //Passo 4 - Assembly the Fuzzy rules
44 // FuzzyRule "IF distance = samll THEN velocity = slow"
45 FuzzyRuleAntecedent* ifDistanceSmall = new FuzzyRuleAntecedent(); // Instantiating an Antecedent to expression
46 ifDistanceSmall->joinSingle(small); // Adding corresponding FuzzySet to Antecedent object
47 FuzzyRuleConsequent* thenVelocitySlow = new FuzzyRuleConsequent(); // Instantiating a Consequent to expression
48 thenVelocitySlow->addOutput(slow);// Adding corresponding FuzzySet to Consequent object
49 // Instantiating a FuzzyRule object
50 FuzzyRule* fuzzyRule01 = new FuzzyRule(1, ifDistanceSmall, thenVelocitySlow); // Passing the Antecedent and the
51
52 fuzzy->addFuzzyRule(fuzzyRule01); // Adding FuzzyRule to Fuzzy object
53
54 // FuzzyRule "IF distance = safe THEN velocity = normal"
55 FuzzyRuleAntecedent* ifDistanceSafe = new FuzzyRuleAntecedent(); // Instantiating an Antecedent to expression
56 ifDistanceSafe->joinSingle(safe); // Adding corresponding FuzzySet to Antecedent object
57 FuzzyRuleConsequent* thenVelocityAverage = new FuzzyRuleConsequent(); // Instantiating a Consequent to expressi
58 thenVelocityAverage->addOutput(average); // Adding corresponding FuzzySet to Consequent object
59 // Instantiating a FuzzyRule object
60 FuzzyRule* fuzzyRule02 = new FuzzyRule(2, ifDistanceSafe, thenVelocityAverage); // Passing the Antecedent and t
61
62 fuzzy->addFuzzyRule(fuzzyRule02); // Adding FuzzyRule to Fuzzy object
63
64 // FuzzyRule "IF distance = big THEN velocity = fast"
65 FuzzyRuleAntecedent* ifDistanceBig = new FuzzyRuleAntecedent(); // Instantiating an Antecedent to expression
66 ifDistanceBig->joinSingle(big); // Adding corresponding FuzzySet to Antecedent object
67 FuzzyRuleConsequent* thenVelocityFast = new FuzzyRuleConsequent(); // Instantiating a Consequent to expression
68 thenVelocityFast->addOutput(fast);// Adding corresponding FuzzySet to Consequent object
69 // Instantiating a FuzzyRule object
70 FuzzyRule* fuzzyRule03 = new FuzzyRule(3, ifDistanceBig, thenVelocityFast); // Passing the Antecedent and the C
71
72 fuzzy->addFuzzyRule(fuzzyRule03); // Adding FuzzyRule to Fuzzy object
73 }
74
75 void loop(){
76 float dist = getDistanceFromSonar();
77
78 // Step 5 - Report inputs value, passing its ID and value
79 fuzzy->setInput(1, dist);
80 // Step 6 - Exe the fuzzification
81 fuzzy->fuzzify();
82 // Step 7 - Exe the desfuzzyficao for each output, passing its ID
83 float output = fuzzy->defuzzify(1);
84
85 setRobotSpeed(output);
86
87 delay(100);
88 }

Brief documentation

Fuzzy object - This object includes all the Fuzzy System, through it, you can manipulate the Fuzzy Sets, Linguistic
Rules, inputs and outputs.

2 de 9 02-08-2016 21:34
zerokol.com: eFLL - A Fuzzy Library for Arduino and Embeded Systems http://www.zerokol.com/2012/09/arduinofuzzy-fuzzy-library-for-arduino...

FuzzyInput object - This object groups all entries Fuzzy Sets that belongs to the same domain.

FuzzyOutput object - This object is similar to FuzzyInput, is used to group all output Fuzzy Sets thar belongs to the
same domain.

FuzzySet object - This is one of the main objects of Fuzzy Library, with each set is possible to model the system in
question. Currently the library supports triangular membership functions, trapezoidal and singleton, which are assembled
based on points A, B, C and D, they are passed by parameter in its constructor FuzzySet(float a, float b, float c, float
examples:

Triangular pertinence function:

FuzzySet* fs = FuzzySet(10, 20, 20, 30);

FuzzySet* fs = FuzzySet(10, 33, 33, 33);

FuzzySet* fs = FuzzySet(5, 5, 5, 30);

Trapezoidal pertinence function:

FuzzySet* fs = FuzzySet(10, 20, 30, 40);

FuzzySet* fs = FuzzySet(0, 0, 10, 20);


Any value below 10 will have pertinence = 1

FuzzySet* fs = FuzzySet(20, 30, 40, 40);


Any value above 30 will have pertinence = 1

Singleton pertinence function:

FuzzySet* fs = FuzzySet(20, 20, 20, 20);

FuzzyRule object - This object is used to mount the base rule of Fuzzy object, which contains one or more of this object
nstantiated with FuzzyRule fr = new FuzzyRule (ID, antecedent, consequent)

FuzzyRuleAntecedent object - This object is used to compound the object FuzzyRule, responsible for assembling the
antecedent of the conditional expression of a FuzzyRule, examples:

"IF distance = small THEN velocity = slow"

3 de 9 02-08-2016 21:34
zerokol.com: eFLL - A Fuzzy Library for Arduino and Embeded Systems http://www.zerokol.com/2012/09/arduinofuzzy-fuzzy-library-for-arduino...

FuzzyRuleAntecedent* ifDistanceSmall = new FuzzyRuleAntecedent(); ifDistanceSmall->joinSingle(small);

The method joinSingle(FuzzySet* fuzzySet) is used to build simple expressions IF/THEN. To compose more complex
expressions there are other special methods.

"IF temperature = hot AND pressure = hight THEN rick = big"

FuzzyRuleAntecedent* ifTemperatureHotAndPressureHight = new FuzzyRuleAntecedent();


ifTemperatureHotAndPressureHight->joinWithAND(hot, hight);

"IF temperature = hot OR pressure = hight THEN rick = big"

FuzzyRuleAntecedent* ifTemperatureHotAndPressureHight = new FuzzyRuleAntecedent();


ifTemperatureHotAndPressureHight->joinWithOR(hot, hight);

The methods joinWithAND(FuzzySet* fuzzySet1, FuzzySet* fuzzySet2) and joinWithOR(FuzzySet* fuzzySet1, FuzzySet*
fuzzySet2) can make logical compositions between Fuzzy Sets. These methods also have more advanced variations that
allow further enhance the expression, they are:

bool joinWithAND(FuzzySet* fuzzySet, FuzzyRuleAntecedent* fuzzyRuleAntecedent);


bool joinWithAND(FuzzyRuleAntecedent* fuzzyRuleAntecedent, FuzzySet* fuzzySet);
bool joinWithOR(FuzzySet* fuzzySet, FuzzyRuleAntecedent* fuzzyRuleAntecedent);
bool joinWithOR(FuzzyRuleAntecedent* fuzzyRuleAntecedent, FuzzySet* fuzzySet);
bool joinWithAND(FuzzyRuleAntecedent* fuzzyRuleAntecedent1, FuzzyRuleAntecedent* fuzzyRuleAntecedent2);
bool joinWithOR(FuzzyRuleAntecedent* fuzzyRuleAntecedent1, FuzzyRuleAntecedent* fuzzyRuleAntecedent2);

examples:

"IF (velocity = hight AND distance = small) OR fuel = low THEN velocity = small AND consumption = short"

FuzzyRuleAntecedent* speedHightAndDistanceSmall = new FuzzyRuleAntecedent();


speedHightAndDistanceSmall->joinWithAND(hight, small);

FuzzyRuleAntecedent* fuelLow = new FuzzyRuleAntecedent();


fuelLow->joinSingle(low);

// Este objeto FuzzyRuleAntecedente que ser usada para compor o objeto FuzzyRule
FuzzyRuleAntecedent* ifSpeedHightAndDistanceSmallOrFuelLow = new FuzzyRuleAntecedent();
ifSpeedHightAndDistanceSmallOrFuelLow->joinWithOR(speedHightAndDistanceSmall, fuelLow);

Using these methods, any expression can be mounted, FuzzyRuleAntecedent can be used to compose another object
FuzzyRuleAntecedent, in many different ways.
OBS:. in the previous example, the final antecedent was composed of speedHightAndDistanceSmall and fuelLow
objects, but the latter could be replaced without loss by the FuzzySet object low, since it is a simple expression, without
any conditional operator:

FuzzyRuleAntecedent* speedHightAndDistanceSmall = new FuzzyRuleAntecedent();


speedHightAndDistanceSmall->joinWithAND(hight, small);

// Este objeto FuzzyRuleAntecedente que ser usada para compor o objeto FuzzyRule
FuzzyRuleAntecedent* ifSpeedHightAndDistanceSmallOrFuelLow = new FuzzyRuleAntecedent();
ifSpeedHightAndDistanceSmallOrFuelLow->joinWithOR(speedHightAndDistanceSmall, low);

FuzzyRuleConsequente object - This object is used to render the object FuzzyRule, responsible for assembling the
output expression of a FuzzyRule, examples:

"IF disctance = small THEN velocity = slow"

FuzzyRuleConsequent* thenSpeedSlow = new FuzzyRuleConsequent();


thenSpeedSlow->addOutput(slow);

What would result in an FuzzyRule object like:

FuzzyRule* fuzzyRule = new FuzzyRule(2, ifDistanceSmall, thenSpeedSlow);

"IF (velocity = hight AND distance = small) OR fuel = low THEN velocity = small AND consumption = short"

FuzzyRuleConsequent* thenSpeedSmallAndFeedTine = new FuzzyRuleConsequent(); thenSpeedSmallAndFeedSmall->addOutput

thenSpeedSmallAndFeedSmall->addOutput(tine);

For the object FuzzyRuleConsequent entire expression is mounted using the method addOutput(FuzzySet* fuzzySet);

What would result in an FuzzyRule object like:

FuzzyRule* fuzzyRule = new FuzzyRule(2, ifSpeedHightAndDistanceSmallOrFuelLow, thenSpeedSmallAndFeedTine);

After assembling an FuzzyRule object, use the method addFuzzyRule(FuzzyRule* fuzzyRule); to add it to Fuzzy object
base rule, repeat the same process for all the rules.

4 de 9 02-08-2016 21:34
zerokol.com: eFLL - A Fuzzy Library for Arduino and Embeded Systems http://www.zerokol.com/2012/09/arduinofuzzy-fuzzy-library-for-arduino...

Tip

These are all eFLL library objects that are used in the process. The next step, generally interactive is handled by three
methods of the Fuzzy Class first:

bool setInput(int id, float value);

It is used to pass the Crispe input value to the system note that the first parameter is the FuzzyInput object' ID which
parameter value is intended.

bool fuzzify();

It is used to start the fuzzification process, composition and inference.

And finally:

float defuzzify(int id);

It is used to finalize the fuzzification process, notice that the param ID belongs to FuzzyOutput object which you want to
get the defuzzification value.

Hint: Sometimes is necessary to know the pertinence with which some or each fuzzy set was activated. To do this, use
the method float getPertinence(); of FuzzySet Class, eg:

FuzzySet* hot = new FuzzySet(30, 50, 50, 70);


...
... // After fuzzification with ->fuzzyfy();
...
float pertinenceOfHot = hot->getPertinence();

Or whether a particular rule was fired, use the method bool isFiredRule(int ruleId); of Fuzzy object.

FuzzyRule* fuzzyRule = new FuzzyRule(2, ifDistanceSmall, thenSpeedSlow);


...
... // After fuzzification with ->fuzzyfy();
...
bool wasTheRulleFired = fuzzy->isFiredRule(2);

Advanced example:

1 #include <FuzzyRule.h>
2 #include <FuzzyComposition.h>
3 #include <Fuzzy.h>
4 #include <FuzzyRuleConsequent.h>
5 #include <FuzzyOutput.h>
6 #include <FuzzyInput.h>
7 #include <FuzzyIO.h>
8 #include <FuzzySet.h>
9 #include <FuzzyRuleAntecedent.h>
10
11 // Instantiating an object of library
12 Fuzzy* fuzzy = new Fuzzy();
13
14 FuzzySet* close = new FuzzySet(0, 20, 20, 40);
15 FuzzySet* safe = new FuzzySet(30, 50, 50, 70);
16 FuzzySet* distante = new FuzzySet(60, 80, 100, 100);
17
18 FuzzySet* stoped = new FuzzySet(0, 0, 0, 0);
19 FuzzySet* slow = new FuzzySet(1, 10, 10, 20);
20 FuzzySet* normal = new FuzzySet(15, 30, 30, 50);
21 FuzzySet* quick = new FuzzySet(45, 60, 70, 70);
22
23 FuzzySet* cold = new FuzzySet(-30, -30, -20, -10);
24 FuzzySet* good = new FuzzySet(-15, 0, 0, 15);
25 FuzzySet* hot = new FuzzySet(10, 20, 30, 30);
26
27 void setup(){
28 Serial.begin(9600);
29
30 // FuzzyInput
31 FuzzyInput* distance = new FuzzyInput(1);
32 distance->addFuzzySet(close);
33 distance->addFuzzySet(safe);
34 distance->addFuzzySet(distante);
35
36 fuzzy->addFuzzyInput(distance);
37
38 // FuzzyInput
39 FuzzyInput* inputSpeed = new FuzzyInput(2);
40 inputSpeed->addFuzzySet(stoped);
41 inputSpeed->addFuzzySet(slow);
42 inputSpeed->addFuzzySet(normal);
43 inputSpeed->addFuzzySet(quick);
44
45 fuzzy->addFuzzyInput(inputSpeed);
46
47 // FuzzyInput
48 FuzzyInput* temperature = new FuzzyInput(3);
49 temperature->addFuzzySet(cold);
50 temperature->addFuzzySet(good);
51 temperature->addFuzzySet(hot);
52
53 fuzzy->addFuzzyInput(temperature);
54
55 // FuzzyOutput
56 FuzzyOutput* risk = new FuzzyOutput(1);
57
58 FuzzySet* minimum = new FuzzySet(0, 20, 20, 40);
59 risk->addFuzzySet(minimum);

5 de 9 02-08-2016 21:34
zerokol.com: eFLL - A Fuzzy Library for Arduino and Embeded Systems http://www.zerokol.com/2012/09/arduinofuzzy-fuzzy-library-for-arduino...

60 FuzzySet* average = new FuzzySet(30, 50, 50, 70);


61 risk->addFuzzySet(average);
62 FuzzySet* maximum = new FuzzySet(60, 80, 80, 100);
63 risk->addFuzzySet(maximum);
64
65 fuzzy->addFuzzyOutput(risk);
66
67 // FuzzyOutput
68 // adding speed as output too
69 FuzzyOutput* outputSpeed = new FuzzyOutput(2);
70
71 FuzzySet* stopedOut = new FuzzySet(0, 0, 0, 0);
72 outputSpeed->addFuzzySet(stopedOut);
73 FuzzySet* slowOut = new FuzzySet(1, 10, 10, 20);
74 outputSpeed->addFuzzySet(slowOut);
75 FuzzySet* normalOut = new FuzzySet(15, 30, 30, 50);
76 outputSpeed->addFuzzySet(normalOut);
77 FuzzySet* quickOut = new FuzzySet(45, 60, 70, 70);
78 outputSpeed->addFuzzySet(quickOut);
79
80 fuzzy->addFuzzyOutput(outputSpeed);
81
82 // Building FuzzyRule
83 FuzzyRuleAntecedent* distanceCloseAndSpeedQuick = new FuzzyRuleAntecedent();
84 distanceCloseAndSpeedQuick->joinWithAND(close, quick);
85 FuzzyRuleAntecedent* temperatureCold = new FuzzyRuleAntecedent();
86 temperatureCold->joinSingle(cold);
87 FuzzyRuleAntecedent* ifDistanceCloseAndSpeedQuickOrTemperatureCold = new FuzzyRuleAntecedent();
88 ifDistanceCloseAndSpeedQuickOrTemperatureCold->joinWithOR(distanceCloseAndSpeedQuick, temperatureCold);
89
90 FuzzyRuleConsequent* thenRisMaximumAndSpeedSlow = new FuzzyRuleConsequent();
91 thenRisMaximumAndSpeedSlow->addOutput(maximum);
92 thenRisMaximumAndSpeedSlow->addOutput(slowOut);
93
94 FuzzyRule* fuzzyRule1 = new FuzzyRule(1, ifDistanceCloseAndSpeedQuickOrTemperatureCold, thenRisMaximumAndSpee
95 fuzzy->addFuzzyRule(fuzzyRule1);
96
97 // Building FuzzyRule
98 FuzzyRuleAntecedent* distanceSafeAndSpeedNormal = new FuzzyRuleAntecedent();
99 distanceSafeAndSpeedNormal->joinWithAND(safe, normal);
100 FuzzyRuleAntecedent* ifDistanceSafeAndSpeedNormalOrTemperatureGood = new FuzzyRuleAntecedent();
101 ifDistanceSafeAndSpeedNormalOrTemperatureGood->joinWithOR(distanceSafeAndSpeedNormal, good);
102
103 FuzzyRuleConsequent* thenRiskAverageAndSpeedNormal = new FuzzyRuleConsequent();
104 thenRiskAverageAndSpeedNormal->addOutput(average);
105 thenRiskAverageAndSpeedNormal->addOutput(normalOut);
106
107 FuzzyRule* fuzzyRule2 = new FuzzyRule(2, ifDistanceSafeAndSpeedNormalOrTemperatureGood, thenRiskAverageAndSpe
108 fuzzy->addFuzzyRule(fuzzyRule2);
109
110 // Building FuzzyRule
111 FuzzyRuleAntecedent* distanceDistanteAndSpeedSlow = new FuzzyRuleAntecedent();
112 distanceDistanteAndSpeedSlow->joinWithAND(distante, slow);
113 FuzzyRuleAntecedent* ifDistanceDistanteAndSpeedSlowOrTemperatureHot = new FuzzyRuleAntecedent();
114 ifDistanceDistanteAndSpeedSlowOrTemperatureHot->joinWithOR(distanceDistanteAndSpeedSlow, hot);
115
116 FuzzyRuleConsequent* thenRiskMinimumSpeedQuick = new FuzzyRuleConsequent();
117 thenRiskMinimumSpeedQuick->addOutput(minimum);
118 thenRiskMinimumSpeedQuick->addOutput(quickOut);
119
120 FuzzyRule* fuzzyRule3 = new FuzzyRule(3, ifDistanceDistanteAndSpeedSlowOrTemperatureHot, thenRiskMinimumSpeed
121 fuzzy->addFuzzyRule(fuzzyRule3);
122 }
123
124 void loop(){
125 fuzzy->setInput(1, 10);
126 fuzzy->setInput(2, 30);
127 fuzzy->setInput(3, -15);
128
129 fuzzy->fuzzify();
130
131 Serial.print("Distance: ");
132 Serial.print(close->getPertinence());
133 Serial.print(", ");
134 Serial.print(safe->getPertinence());
135 Serial.print(", ");
136 Serial.println(distante->getPertinence());
137
138 Serial.print("Speed: ");
139 Serial.print(stoped->getPertinence());
140 Serial.print(", ");
141 Serial.print(slow->getPertinence());
142 Serial.print(", ");
143 Serial.print(normal->getPertinence());
144 Serial.print(", ");
145 Serial.println(quick->getPertinence());
146
147 Serial.print("Temperature: ");
148 Serial.print(cold->getPertinence());
149 Serial.print(", ");
150 Serial.print(good->getPertinence());
151 Serial.print(", ");
152 Serial.println(hot->getPertinence());
153
154 float output1 = fuzzy->defuzzify(1);
155 float output2 = fuzzy->defuzzify(2);
156
157 Serial.print("Risk output: ");
158 Serial.print(output1);
159 Serial.print(", Speed output: ");
160 Serial.println(output2);
161
162 delay(100000);
163 }

Another example: https://gist.github.com/4110773

6 de 9 02-08-2016 21:34
zerokol.com: eFLL - A Fuzzy Library for Arduino and Embeded Systems http://www.zerokol.com/2012/09/arduinofuzzy-fuzzy-library-for-arduino...

Biblioteca eFLL licenciada sob uma Licena Creative Commons Atribuio-SemDerivados 3.0 No Adaptada.
Baseado no trabalho em http://github.com/zerokol/eFLL.
Persses alm do escopo dessa licena podem estar disponvel em http://zerokol.com.

Poder tambm gostar de:

eFLL - Uma O que ZeRoKoL? Content Provider: Continuous2Wheel Continuous2Wheel


Biblioteca Fuzzy Compartilhando s - For two wheels s - Para robs
para Arduino e Informaes no servo motor Arduino de duas
Sistemas ... Android. Arduino ... rodas com ...

Linkwithin

24 comentrios:
Arbie disse...
AJ O. Alves

Thanks for the team who want to share this library for arduino. what a great job's.. :) by the way i want to ask
about the variabel get from ADC (example input LM35 & output relay) where do i place
analogRead('variabel') as a fuzzy input and digitalWrite(13,HIGH/LOW) as a fuzzy output i'm still confuse it..

i want to apologize cause bad english (i'm from indonesia),I really appreciate your help and send me some
tutorial
bimo.ardi.h@gmail.com

thanks before.. :)
19 de novembro de 2012 00:25

AJ O. Alves disse...
Thanks Arbie!

As I replied to you via email.


But his doubts may be the same as others, then:
To see an example of how to use the library and make decisions across the state rules with
Fuzzy::isFiredRule(int id); see https://gist.github.com/4110773
19 de novembro de 2012 11:17

Pat disse...
Thank you very much for providing this great library to the Adruino community!
I'm currently using it in a "robotic fireman toy truck" project to drive the speed and direction of the truck.

I'm just beginning the implementation but thanks to your doc and samples it's going fine.

Patrice
http://breizhmakers.over-blog.com/
25 de novembro de 2012 15:20

Arbie disse...
Hi AJ...

i've got trouble at result of defuzzyfy when i have 2 or more fuzzyrule using same fuzzyrule consequent but
different fuzzyantecedent...

but when i have 1 fuzzyrule using different fuzzyrule consequent it works..

why..??
example i' have 2 input
1.temperature have 5 variable
2.moisture have 3 Variable

and 1 output
1.time have 7 variable

so i must building 3x5 fuzzyrule = 15 fuzzyrule, there 12 fuzzyrule have same fuzzyconsequent... any idea to
solve my problem..??

thank you.. for helping me :)

thank
28 de novembro de 2012 04:25

AJ O. Alves disse...
Thanks one more time Arbie!!!

7 de 9 02-08-2016 21:34
zerokol.com: eFLL - A Fuzzy Library for Arduino and Embeded Systems http://www.zerokol.com/2012/09/arduinofuzzy-fuzzy-library-for-arduino...

This fix, was solved!


You're helping to improve our library!!!
28 de novembro de 2012 22:07

AlanK disse...
Thank you so much for providing this fantastic library as an open source. I can finally finish something I
started looking at many years ago but never quite got around to finishing!
16 de dezembro de 2012 18:08

Christophe disse...
Very interesting indeed. I dont have a lot of experience with libraries, but Id like to share two ideas :
- is it possible to have a boolean output with defuzzyfication ? Most outputs are boolean. I know you can
arrange that with some slow PWM, but there should be a better way
- is it possible to reuse fuzzysets ? In the example I see the same set defined more than once.
- using some #defines could allow to make the usage a bit lighter. IMHO it would allow to reduce
verbosity/hide the OO construction/links. For example

#define IFINPUTSET(name,set) FuzzyRuleAntecedent* name = new FuzzyRuleAntecedent();


name->joinSingle(set);
8 de janeiro de 2013 10:17

Unknown disse...
can the system read negative value? i try to feed the system with negative input, but the output is wrong, any
solution. thanks
23 de fevereiro de 2013 23:38

AJ O. Alves disse...
Christophe, thanks so much for your notes!
24 de fevereiro de 2013 10:21

AJ O. Alves disse...
Hey Unknow, it is possible! One of my tests is using only negative numbers in FuzzySets and Inputs, and
always i get a good result.

Please, can you explain better what you are trying to do, how are you building your FuzzySets. Take a good
look in "Advanced Example" in this post, i use a negative FuzzySet called "cold" and after i pass a negative
value in the third input.
24 de fevereiro de 2013 10:27

Unknown disse...

7 de maro de 2013 18:24

Unknown disse...

7 de maro de 2013 18:25

Unknown disse...
unknow here, the library works, i'm sory about that
7 de maro de 2013 18:50

AJ O. Alves disse...
Ok Sam, thanks to use our library. any doubt, aj.alves@zerokol.com
7 de maro de 2013 21:24

sreeram disse...
i've got trouble at result of defuzzyfy when i have 2 or more fuzzyrule using same fuzzyrule consequent but
different fuzzyantecedent...

but when i have 1 fuzzyrule using different fuzzyrule consequent it works..

why..??
example i' have 2 input
1.temperature have 4 variable
2.humidity have 4 Variable
17 de abril de 2013 01:23

AJ O. Alves disse...
Sreeram, shuld you send me a email (aj.alves@zerokol.com) with the source code?
17 de abril de 2013 08:26

LectorCompulsivo disse...
Just for those who have the same problem: The library cannot be imported to Arduino unless that the folder
name will be changed from eFLL-master to eFLLmaster.

Thanks to all who disinterestedly contribute!


6 de maio de 2013 18:46

8 de 9 02-08-2016 21:34
zerokol.com: eFLL - A Fuzzy Library for Arduino and Embeded Systems http://www.zerokol.com/2012/09/arduinofuzzy-fuzzy-library-for-arduino...

Annimo disse...
Hi, i have same problem like Sreeram, i have 2 inputs, and one output.
"when i have 2 or more fuzzyrule using same fuzzyrule consequent but different fuzzyantecedent"

can someone help?


my email ketcchman@gmail.com
or skype pente_
9 de maio de 2013 12:50

sreeram disse...
I had change the library name eFLL-master to eFLL and still it doesn't works.
21 de maio de 2013 02:03

Reza Zulfan disse...


Hi AJ...

i've got trouble at result of defuzzyfy when i have 2 or more fuzzyrule using same fuzzyrule consequent but
different fuzzyantecedent...

why..??
example i' have 3 input from gyro sensor
1.X-axis have 4 variable
2.Y-axis have 4 Variable
3.Z-axis have 4 Variable

and 1 output
1.move have 6 variable

so i must building 4x4x4 fuzzyrule??

I really appreciate your help and send me some tutorial


rezazulfan@gmail.com
thanks before.. for helping me :)
3 de junho de 2013 08:57

Unknown disse...
how i know which desfuzzy method im using ?
And by the way fuzzy->setInput(1, dist); how i know the correct value for Dist ?
26 de outubro de 2015 14:35

Hector Alexandre disse...


Boa Tarde meu amigo. Estou tentando utilizar a sua biblioteca para desenvolver um rob que desvia de
obstculos. Ele possui 4 sensores infravermelhos da Sharp ( 3 frontais e um traseiro ). Estou com um pouco
de dificuldade para saber quais dados coloco na funo "FuzzySet(0, 20, 20, 40)". As fotos do seu site no
esto carregando. Sabe dizer quando voltar ao normal? Voc poderia me enviar esse manual?
7 de dezembro de 2015 15:33

John S disse...
Hi, I'm working in a system to control a dc/dc converter, and I have two inputs, 1 output and 16 rules. I
designed the controller in Matlab and tested on arduino. The problem is that the same controller has different
values for the output when tested in Matlab and Arduino. When one rule is fired, can I know their value at the
output membership?, the thing is that I have 4 active rules and the output in Matlab is the average of the
memberships, but in Arduino seems to be the maximum of memberships. I was wondering what does
minimum-mandani mean at the output?
Thanks
28 de maro de 2016 11:50

amruta disse...
Thank you so much for the library
13 de abril de 2016 08:26

Postar um comentrio

Assinar: Postar comentrios (Atom)

Todos os Direitos reservados a ZeRoKoL.com. Modelo Awesome Inc.. Tecnologia do Blogger.

9 de 9 02-08-2016 21:34

Anda mungkin juga menyukai