Expert system with Arduino and fuzzy Logic

Fuzzy logic or heuristic logic is based on the relative of what is observed as a differential position. This type of logic takes two random values, but contextualized and referred to each other. Thus, for example, a person measuring 2 meters is clearly a tall person, if the low person value has been previously taken and set to 1 meter. Both values are contextualized to people and referred to a linear metric measure.

Diffuse logic is used when the complexity of the process in question is very high and there are no precise mathematical models, for highly nonlinear processes and when definitions and knowledge not strictly defined are involved. On the other hand, it is not a good idea to use it when some mathematical model already efficiently solves the problem, when the problems are linear or when they have no solution.

What is going to be done is a car, which has the ability to change direction by finding an obstacle in its path, for this purpose 1 servo motor and 2 motors (tires), two battery banks, one to power the center of operations (arduino) and another for the motors, in addition an ultrasonic sensor and a Bridge H circuit will also be used.

Below will be shown diagrams on which we will rely to build the corresponding circuit.




In Arduino you should use the Fuzzy library, which is the one in charge of checking if there is an obstacle to the front, and if there is lower speed and make a decision turn either left or right.



Fuzzy Logic code:


The fuzzy logic for the control of systems has its advantages and disadvantages, and therefore we must know and analyze them, among others we will consider the following:

 With systems based on fuzzy logic, more variables can be evaluated, among others, linguistic, non-numerical variables, simulating human knowledge.

It relates inputs and outputs, without having to understand all the variables, allowing the system to be more reliable and stable than one with a conventional control system.

It is possible to simplify the assignment of previous solutions to unsolved problems.

It is possible to obtain prototypes quickly, since it does not require knowing all the variables about the system before starting work, its development being cheaper than that of conventional systems, because they are easier to designate.

The acquisition and representation of knowledge is also simplified and a few rules cover many complexities.

 For all the above, which on the one hand can be an advantage and on the other a possible risk, systems based on fuzzy logic require greater simulation and excellent debugging and testing before becoming operational.


We could summarize that the use of fuzzy logic is advisable for very complex processes, that is, when a simple mathematical model is lacking or for highly non-linear processes.
Authors:
  • Fabricio Gómez Avila
  • Saúl Arias Durán




Comentarios