eFLL (Embedded Fuzzy Logic Library) - Fuzzy Logic on Arduino

I don't understand why you want to use fuzzy logic to control a LED using a joystick, simulated or not.

Maybe it's better to control an heater?

Thanks for your support

Currently i want to have some fun using Fuzzy logic to autonomously fly min helicopter
already the fuzzy logic code are generated for yaw pitch and throttle

sample of my simulated fuzzy viewer is attached, all i want is to communicate the view joysticks to transmit pulses to the arduino

sample codes to keep running at the arduino background tested and working code provided in the following link

or

fuzzyViewr.JPG

Oh, that's totally different. You want to implement a FlyByWire system?

If you will use Embedded Fuzzy Logic Library all the logic must be into Arduino. It will receive commands from the joystick in some way, directly or via a PC.

The other way can be an external more powerful unit with all the logic and an arduino only for controlling the hardware.

Am using IR infared LED to interface Arduino and the target Helicopter

My problem is how to interface the fuzzy logic rule viewer to arduino whereas adjusting
the joysticks will change the current state of the arduino

alternatively i may also prefer to interface the fuzzy logic to simulink to control the helicopter

i would like to use either a joystick or button to send values to the arduino

Is it possible to make an automatic transmission in.a hybrid electric vehicle using fuzzy logic in arduino? Do you have similar projects about this which I can use to base my program using fuzzy logic through arduino?

Hi!
I am using this library to generate a code for inverted pendulum balancing. The inputs to the Fuzzy Logic Controller are coming from accelerometer and gyroscope. The output of the FLC is showing pertinence in it's sets, but output itself remains zero all the time. Please help me solve this problem. Thanks.

nidd:
Hi!
I am using this library to generate a code for inverted pendulum balancing. The inputs to the Fuzzy Logic Controller are coming from accelerometer and gyroscope. The output of the FLC is showing pertinence in it's sets, but output itself remains zero all the time. Please help me solve this problem. Thanks.

Hi, I have the same problem.. I also saw that it activated the correct rule but output is always zero..

Please help me solve this problem. Thanks.

zerokol:
the eFLL (Embedded Fuzzy Logic Library) library is a versatile, lightweight and efficient option to work with Fuzzy Logic in embedded systems, including our great Arduino!

To know more about it, visit:

Documantation, usage, examples: eFLL - A Fuzzy Library for Arduino and Embedded Systems - zkl doc - blog.zerokol.com

Oficial code page: GitHub - alvesoaj/eFLL: eFLL (Embedded Fuzzy Logic Library) is a standard library for Embedded Systems

Hi

Which board would you suggest for implementing fuzzy logic control??

Thanks
Emmanuel

Emmanuel, you need at least a 32kB flash board.

I'm trying eFLL on a Arduino Pro mini, and as nidd and mccr, my output remains at zero. But examples works fine. I think I'm not using the lib correctly, but I can't find the problem.

My inputs/outputs FuzzySet are normalized, and I can see that inputs are correctly activated, according to the rules.

I attached my code...

Any help welcome.

eFLL_servo.ino (21.2 KB)

Mmm, I compiled the same C++ code using g++, on my PC (no cross-compilation), and all works fine!

Looks like an lib-AVR float issue, or something like that...

For the records...

Not a float issue at all! Problems come from memory: you can't use a 7x7 rules matrix with an AVR!

Good practice is to test all addFuzzyxxx() call, and check if they return true. If not, it means there is not enough memory to store the object.

Hope this helps.

first, thanks for this good library
second

is there a way to declare and work with two fuzzy controller independent on same programe like that

Fuzzy* fuzzy = new Fuzzy();
Fuzzy* fuzzy2 = new Fuzzy();

for fuzzy one

FuzzySet* angleZ = new FuzzySet(10 ,0,0,-10);

but how can I use fuzzy2 ??????

hello, I'm new to arduino.
here I have a problem. I'm going to use this library to program my robot. I'm using ultrasonic SRF02 as sensor to get the distance, and the output are dc motors.
the problem is, when I include this library to my program (and my fuzzy function too) suddenly my ultrasonic doesn't work. It can show the distance and only display 0. but when I remove my fuzzy function and this library the ultrasonic is working again. could anyone please help me fix this? maybe this library ruined the timing or what?

How many fuzzy sets we can add in it?
Actually i am using two input and one output system, with 6 fuzzy sets in each input. and in output 7 fuzzy sets are there. It is fuzzifying the inputs, but in output it is showing zero.

fma:
For the records...

Not a float issue at all! Problems come from memory: you can't use a 7x7 rules matrix with an AVR!

Good practice is to test all addFuzzyxxx() call, and check if they return true. If not, it means there is not enough memory to store the object.

Hope this helps.

Will it work with Arduino Due?

It seems some people have the same problem as I do. I am getting zero from the controller output on my code, but when I run the example it seems to work just fine. Any ideas on why this could be happening?

fuzzy1.ino (6.1 KB)

I have about 25 rules and I am not able to run more than 8 rules when I convert the file to Arduino. Is there any restriction on the number of rules?

I have same problem about 45 rules and I am not able to run more than 4 rules when I convert the file to Arduino. Is there any restriction on the number of rules? I'm running this code in a Arduino Mega the code runs properly up to 4 rules but when I add the 5th rule no awnsers in the monitor, no errors or warning. Just nothing appears.

I have tried doing fuzzy simulation in MATLAB, so I got the expected output which later would be the same for arduino execution by using fuzzy library. However, in MATLAB, they got another option for defuzzification and fuzzification method such as MOM, LOM, SOM, and centroid.

So, how can I do the same for Arduino code? I would like to have the MOM defuzzification using Mamdani type of inference.

zerokol:
the eFLL (Embedded Fuzzy Logic Library) library is a versatile, lightweight and efficient option to work with Fuzzy Logic in embedded systems, including our great Arduino!

To know more about it, visit:

Documantation, usage, examples: eFLL - A Fuzzy Library for Arduino and Embedded Systems - zkl doc - blog.zerokol.com

Oficial code page: GitHub - alvesoaj/eFLL: eFLL (Embedded Fuzzy Logic Library) is a standard library for Embedded Systems

I have found a problem, when adding a second output to the system it sends everything to zero, perhaps there is some limit of membership functions that I can add to the output.