Fuzzy Logic Algorithm 101
Introduction to Application
Fuzzy logic algorithm uses simple terms like “large” or “cold” to calculate the output. Because of linguistic inputs, the algorithm is popular in control and analysis. There are many benefits of using a fuzzy logic algorithm, which are
1. Efficient and lost cost for automation.
2. Easily solve nonlinear control problems using human knowledge.
3. Fuzzy control is applicable in practical systems.
Unlike a binary system which has crisp values of 0 or 1, fuzzy logic can be partial in a set. This is called the degree of membership in the alpha value. For example, lets look at the temperature of a water.
Using a crisp definition of “cold,” water temperature below 26 C would count. If the water temperature is 26.3 C, it wouldn’t count.
Degree of coldness (crisp)
1 for x ⪖ 26 C
0 for x < 26 C
But using a fuzzy logic, the mathematical model might look like this. As water temperature reaches below 30 C, the water is partially getting cold both in the algorithm and the real world.
Degree of coldness (fuzzy)
1 for x ⪖ 30 C
(x-5) / 2 for 25 C ⩽ x < 30 C
0 for x < 25 C
These fuzzy functions are called membership functions, and the process of calculating the variables is called fuzzification. Below is a graph of the fuzzy membership functions.
A simple way to use fuzzy logic is using MATLAB provided system called Fuzzy Logic Toolbox™.
MATLAB fuzzy logic toolbox allows you to design inputs (from 1 to how many you need) and fuzzy membership shapes like triangular and trapezoid. The interface is very simple and there are many YouTube videos providing detailed instruction for using the algorithm.
Here is my use of fuzzy logic algorithm. I am using the algorithm in vehicle power supply system between battery and the supercapacitor. The algorithm balances the powertrain system based on 2 inputs — current peak and current slope.
Thanks for reading! — Brayden Noh