Shop OBEX P1 Docs P2 Docs Learn Events
Fuzzy Logic? — Parallax Forums

Fuzzy Logic?

ProcessingData...ProcessingData... Posts: 208
edited 2009-06-08 20:09 in Propeller 1
I have read about this "Fuzzy Logic", and that the Propeller is capable of it, and that is useful, but that's about all I know about it. I read somewhere that it is like cold, warm, and hot, instead of just hot and cold.
Can someone explain this to me, a 1 and 0 minded programmer? ProcessingData...

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Basic Stamp,···· Propeller,·· · SX,·· FUN!


START:·
>Proccessing Data. . . .··
>Task Complete. . .·.
>Saving Data. . . .
>Entering SLEEP Mode. . . .
>Signing OFF


·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-06 03:01
    The Wikipedia is your friend: en.wikipedia.org/wiki/Fuzzy_logic
  • AleAle Posts: 2,363
    edited 2009-06-06 06:20
    I remember a quite good explanation was available in the HC12 manual, I mean the processor MC68HC12A, that was some 10 long years ago. Using for that the MIN and MAX instructions (also available in the propeller). Wikipedia's entry give a useful introduction, too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-06-06 10:36
    Mike, as usual is on to the best resource. Also, the Viewport software product comes with a nice fuzzy logic demonstration.
    It is free for a 30 day trial download. Contact Hanno at MyDancebot.com.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
  • HannoHanno Posts: 1,130
    edited 2009-06-06 22:09
    Howdy!
    Yes, Fuzzy Logic is integrated into ViewPort.

    It provides a complete, high speed fuzzy logic engine to help you control all sorts of things. I use it to balance my DanceBot. The demo tutorial shows you how to "land on the moon" with fuzzy logic. Others have used it to optimally charge batteries and more. ViewPort provides you with a nice user interface to help you understand fuzzy logic. Want me to put together a video?
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • Chad GeorgeChad George Posts: 138
    edited 2009-06-06 23:05
    Last year I wrote a python based fuzzy logic compiler that outputs to spin or robotc.

    define the fuzzy logic controller using python syntax (no real python knowledge is required other than basic syntax)
    then run the code to generate either SPIN, RobotC, even assembly should be possible, but I didn't implement that yet.

    This produces very tight, customized code for the particular fuzzy controller. I found this to be a little more efficient than a generic fuzzy library approach that recalculates the input and output set shapes every time.

    Maybe if you have alot of different fuzzy logic controllers, a more centralized approach would be better.

    I successfully used it in several robot applications, but it hasn't been widely tested other than by me.

    There's also a visualization tool I wrote for it, but it basically just shows what the input sets look like.

    One thing I think is cool, is the Python code used to "write" the fuzzy logic controller can be run to implement the controller on the PC (or embedded system running Python)

    If anyone's interested, I could dig it out of the archives and post it.
  • SapiehaSapieha Posts: 2,964
    edited 2009-06-06 23:20
    Hi Chad George.

    Very interesting.
    If You can post it

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it·as simple as·possible yet as versatile as posible.


    Sapieha
  • HannoHanno Posts: 1,130
    edited 2009-06-07 02:29
    Finally completed the video of ViewPort's fuzzy logic engine and the lunar lander tutorial- see here for the thread:
    http://forums.parallax.com/forums/default.aspx?f=25&m=357686
    and here for the video:

    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • ProcessingData...ProcessingData... Posts: 208
    edited 2009-06-07 03:13
    Okay, I went and read the wiki article and WHOA! Information overload on bus line! Error probably caused by finally understanding PASM/ASM the last few days. So, the hot cold is somewhat correct, and it has a lot more to do with aproximate values. So, could I use Fuzzy to read analog voltages somewhat with the propeller? Proccessing Data... OVERLOAD!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Basic Stamp,···· Propeller,·· · SX,·· FUN!


    START:·
    >Proccessing Data. . . .··
    >Task Complete. . .·.
    >Saving Data. . . .
    >Entering SLEEP Mode. . . .
    >Signing OFF


    ·
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-06-07 09:28
    Hello,

    for just reading a analog voltages you don't need fuzzy logic at all.

    You can use the ADC-object from the obex. Or any kind of ADC-chip you like combined with supernormal-programming.

    Fuzzy-logic is for controlling devices with a behaviour that has a lot of parameters that influence each other crossover again and again
    and where it is impossible to program mathematical exact rules what the program should do in different situations. Here fuzzy logic can help you
    "find the way out the labyrinth"

    analog-to-digital-conversion is very easy to catch in exact "mathematical" rules

    just use the ADC-object from the obex and don't care about the details how it is done
    or use an external ADC-Chip with a digital interface

    by the way this is another great example how different solutions can be offered as soon as
    details are given what should be done in the end

    I think just reading analog voltages is NOT the end of your project

    Post what you want to do ALL in THE END

    and I bet the forum members will find much better solutions than fuzzy logic

    best regards

    Stefan
  • Chad GeorgeChad George Posts: 138
    edited 2009-06-07 17:50
    Fuzzy logic doesn't always have to involve a large number of parameters or systems that are difficult to describe mathematically.

    Sometimes there is just one input and one output. Like "What is the temperature of the water" and "How much current should go to the heater"

    The real beauty of fuzzy logic is that even when you can figure out a mathematical model of a system...you really don't need to in order to control it effectively.

    Rather fuzzy logic allows the designer to use common sense rules like "IF the water is too hot THEN turn the heat down".

    A handful of rules like this is all that is needed...well you also need to define what HOT, COLD, UP, DOWN, etc. mean, but that's not normally very hard.

    I like to use fuzzy logic instead of PID controllers...but other people prefer the PID method.

    StefanL38 is right, there are often many different paths that lead to the same goal. Sometimes Fuzzy Logic will be the right path and sometimes it will be more of a hurdle than a help.
  • ProcessingData...ProcessingData... Posts: 208
    edited 2009-06-08 14:50
    Okay, thank you. I will look at the ADC object in the obex.
    I'm not really trying to do a project.
    I was talking about the mystery of Fuzzy with my dad one night, and found out he knew about it, sort of. So I thought that I would try to find out if the prop could do it, and what it was. So, after reading through the propeller manual, finding it said something about fuzzy, I went to my dad's old "Microproccessers and Interfacing" book for the 8086/8088 Proccesser. After reading a short, technical and unhelpful paragraph, I thought "Why not try the forums?"
    I'm just trying to find out as much as I can, Assembly, SPIN, Fuzzy logic, controlling servos, ect. I want to have most of the info and knowledge I can get before I try for a project.
    Thanks again for your help. - ProccessingData

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Basic Stamp,···· Propeller,·· · SX,·· FUN!


    START:·
    >Proccessing Data. . . .··
    >Task Complete. . .·.
    >Saving Data. . . .
    >Entering SLEEP Mode. . . .
    >Signing OFF


    ·
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-06-08 20:09
    Hello ProcessingData,

    so if your forum-name is your philosophy go on "processing data" by reading.

    I want to make a suggestion: how about trying a new way of learning be realizing a program ?

    Choose whatever you like, but start DOING it before knowing it all. If you go on just reading for weeks or even longer
    you will forget most of it. Things that you have USED while programming will stay in mind.

    So start processing debug-data in a propeller-program !

    best regards

    Stefan
Sign In or Register to comment.