Logo name
Personal tools

Fuzzy logic block

From Piki

  • Currently2.00/5
Revision as of 21:32, 26 January 2008 by Admin (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

The fuzzy logic component is a full Fuzzy Inference System (FIS) integrated into a block that can be used to integrate fuzzy logic rules and inference into systems.

Function layer
Image:Fuzzy logic icon.jpg
Input ports1
Output ports1
DeployableYes
WeightsNo
MemoryNo
Interactive GUIYes

Contents

Usage

Fuzzy Logic is an extension of regular Boolean logic that allows the use of vague linguistic expression rather than the limited Boolean true/false values.

It is a very powerful tool for use in conjunction with adaptive systems as it is a simple and intuitive way of incorporating a priori knowledge into your system. It allows you to use expressions as for instance:

If speed is very high and ground is slightly wet then breaking distance is very long

An introduction to fuzzy logic goes beyond the documentation of this component, but you can find more theory on fuzzy logic in the following tutorials on the Peltarion blog:

Settings

The settings can be modified using the settings browser.


Fuzzy Logic settings


  • (Layout)
  • Inputs: Number of input features.
  • Outputs: Number of output features.
  • Scale: Determines if the output of the block should be scaled between -1 to 1.
  • (Editors)
  • MFEeditor: Opens the Membership Function editor.
  • Rule Editor: Opens the Rule editor.


GUI details

Fuzzy Logic design GUI
Image:Fuzzy logic design GUI.jpg

Memberhip function editor

Membership Function Editor (MFE)
Image:Membership Function Editor GUI.jpg


In the MFE you can define your membership functions. The number of input variables is equal to the number of inputs and the number of output variables are equal to the number of outputs. The input variables are marked with a big "I" while the output variables are marked with a big "O" in the System explorer:

System explorer
Image:Fuzzy system explorer.jpg

If you select a variable in the explorer, you can change its settings such as name and range:

Fuzzy variable settings.
Image:Fuzzy variable settings.jpg

If you select a membership function in the explorer (marked with "MF" under the variables), you can change the function form by using the bar under the graph:

Membership function selection
Image:Membership function selection.jpg

When you select a membership function in the explorer it becomes blue in the graph and its name is written in the title.

Membership function graphs
Image:Membership function graphs.jpg

In the settings browser you can then change the settings of that specific membership function, such as name and control points (that control the position and shape of the function).

Membership function settings
Image:Membership function settings.jpg

When you are done defining membership functions, you can press the "Close" button to close the MFE.

Rule Editor

Rule Editor
Image:Fuzzy Rule Editor.jpg

In the rule editor, you can write your fuzzy rules. The most straight forward way is simply typing each rule into the textbox and clicking "Add Rule" to add a rule to the system. When typing the rules manually, you can use parentheses to group your logic:

Fuzzy rule entry
Image:Fuzzy rule entry.jpg

If you are not going to use parentheses, then the easiest way to enter a rule is by simply double-clicking on the two tree views. The blue items are the valid ones you can double-click on, and they will automatically be entered in the text box. The top box contains the variables and the membership functions. If you would for instance click on "high", it would write in the text box "If speed is high".

System view
Image:Fuzzy rule editor system view.jpg


In the lower treeview you can double-click on keywords, operators and hedges.

Operator selection
Image:Fuzzy rule editor operators.jpg

Example: To enter "If speed is high and ground is very wet then breaking_distance is long", you would use the following sequence of double clicks:

[high] [and] [ground] [very] [wet] [then] [long]

When you add a rule to the system it will be entered in the rules list. If the rule is grammatically and semantically valid a green checked box will be next to it. If it is invalid a red x will be next to it. If you move your mouse over an incorrect rule, you will see a description of the error in the title bar.

Rules view
Image:Fuzzy rule editor rules.jpg

When you are done defining rules you can press the "Close" button. Remember that all your rules need to be valid for the system to run

See also

Disclaimers