GithubHelp home page GithubHelp logo

michaelaquilina / fuzzy-logic-controller Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 5.0 472 KB

A simulator for a boiler with a fuzzy logic controller to control the pressure.

License: MIT License

C# 100.00%

fuzzy-logic-controller's Introduction

Fuzzy Logic Controller

This was an assignment i wrote for my "Machine Learning, Expert Systems and Fuzzy Logic" course at the University of Malta.

For this assignment, we were required to design and implement a simple fuzzy logic controller that would be able to keep the pressure of a boiler at a set point by using test cases to evaluate its performance. Fuzzy logic controllers are good for such systems because they use analog inputs instead of binary, which allows for a smoother and more refined control over how the pressure changes over time.

The application was implemented using Microsoft’s .NET framework due to its rich library and broad support of different technologies, while the programming language used was C# due to its object oriented nature and ease of use. In order to produce a rich, well defined user interface, WPF was used due to its MVC paradigm and broad range of tools. All the charts in the application were drawn using the WPF Charting Toolkit which is available from Microsoft’s Developer Network.

Design

The system was designed so that all the logic behind the fuzzy logic controller and the simulation were independent from one another to prevent coupling. The user interface which was built for this simulation obtained data from the fuzzy logic controller by means of a simple an API which would allow it to obtain the necessary data when needed. The overall architecture of the system can be seen in the diagram below.

Design Overview

Running the Simulation

The simulation may be run from the “Simulation” tab where the parameters for the simulation may be changed according to the need of the simulation case. The following parameters may be changed from the Simulation tab:

  • Defuzzification Method: specify the method to use during defuzzification. Options provided are Mean of Maxima and Center of Area (described beforehand).
  • Initial Pressure: Specifies the initial pressure the controller should start with.
  • Max No. Iterations: Changes the amount of times the fuzzy logic controller performs an iteration.

Simulation

Rules

The rules used in the controller can be changed and edited when needed using the Rules Editor Tab. Doing so allows observations about how changes in the rules of the controller may change its results and performance. Rules may be created, deleted or edited from the Rules Editor tab. A preview of the selected rule is also shown by drawing the membership functions that represent the rule. Rules may also be enabled or disabled without being deleted by unchecking or checking the appropriate checkbox next to its name.

Rules Editor

Viewing Simulation History

Due to the nature of this assignment, it was important that the values produced by the controller over time could be viewed at the end of the simulation. In order to satisfy such a requirement, the fuzzy logic controller was made to store its output value, output graph and output rule at each iteration during the controller’s runtime. After a simulation is run, the simulation history may be viewed in the “Simulation History” tab of the application where one may choose the iteration to view. The application will show the output graph which is obtained through fuzzy inferencing, the output value calculated by defuzification and the rule that fired at the iteration.

Simulation History

fuzzy-logic-controller's People

Contributors

michaelaquilina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fuzzy-logic-controller's Issues

Rule parameters?

Hi,
I am new to Fuzzy Logic and I would like to know the meaning of parameters in your rule such as A, B, Alpha and Beta.
Do A, B represent the Core in membership function?
Do Alpha, Beta represent the Boundary in membership function?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.