Fuzzy Control Demo

This demo simulates a 2 link robot arm.
i2.jpg


User control

The user (that means you) can apply a force by clicking the mouse on the display. The force applied is proportional to the distance from the cart (like an elastic band). See if you can get home without falling over!

Fuzzy Logic

Fuzzy logic can be used for a wide range of practical applications ranging from what wash to use in your washing machine to the control of robotic limbs. In this demo when the fuzzy logic is enabled the program attempts to control the angle using a set of "fuzzy rules". The inputs are:

The ouput of the system is the requested force value. The fuzzy inference system classifies the input values into degree of membership of fuzzy sets. In this case the sets have names like PB (positive big) PS (positive small) Z (zero) etc. Unlike classical "crisp" logic which only uses 2 values; true and false, the degree of membership of a fuzzy set can be any value between 0 (not in the set e.g. false) and 1 (definately in the set e.g. true).

In this demo the fuzzy controller is define by an FCL (fuzzy control logic) file. You can examine this in the Fuzzy Control Logic tab. In practice this file could be compiled into a program for an embedded micro controller.

Why fuzzy logic

The big deal with fuzzy logic is that you can define your control system using rules that mean something to a human and avoid the complex maths required for some types of classical control. It is common to create fuzzy controllers by asking experts what rules they use.

In this demo the rule.

IF phi IS PS AND dphidt IS PB THEN force IS PB ;

says we should apply a positive big force if the angle is positive small and the rate of change is positive big.

All the rules for the force are combined in a process called defuzzification which which creates a final real value for the force from the degree of membership functions.

Graphs tab

The Graphs tab shows an animation of how the fuzzy system is working. The coloured sections are the fuzzy sets which map the crisp value into a degree of membership. The defuzzication of the force is done by taking the centre of gravity of the force graph.

The rule set for this demo was created in a hurry by the author in order to get the demo working. The rules can be edited (and possibly saved but this feature is untested on windows) using the Fuzzy Control Logic tab. If you manage to create a better system please let me have a copy :-)

PJ.Leonard