![]() |
MSPM0_ValvanoWare
1.0
ECE445L starter code
|
Fuzzy Logic functions. More...
#include <stdint.h>Go to the source code of this file.
Typedefs | |
| typedef uint8_t | fuz_t |
| 8-bit fuzzy variable having values from true (255,254,253,...,2,1,0) false | |
Functions | |
| fuz_t | not (fuz_t u1) |
| Complement. More... | |
| fuz_t | or (fuz_t u1, fuz_t u2) |
| Fuzzy or. More... | |
| fuz_t | or3 (fuz_t u1, fuz_t u2, fuz_t u3) |
| Fuzzy or. More... | |
| fuz_t | and (fuz_t u1, fuz_t u2) |
| Fuzzy and. More... | |
| fuz_t | and3 (fuz_t u1, fuz_t u2, fuz_t u3) |
| Fuzzy and. More... | |
| uint32_t | umin32 (uint32_t u1, uint32_t u2) |
| minimum More... | |
| int32_t | min32 (int32_t n1, int32_t n2, int32_t n3) |
| minimum More... | |
| fuz_t | MinFuzzification (int32_t crisp, const int32_t MIN, const int32_t MAX) |
| Fuzzification. More... | |
| fuz_t | CenterFuzzification (int32_t crisp, const int32_t MIN, const int32_t CENTER, const int32_t MAX) |
| Fuzzification. More... | |
| fuz_t | LeftRightFuzzification (int32_t crisp, const int32_t MIN, const int32_t LEFT, const int32_t RIGHT, const int32_t MAX) |
| Fuzzification. More... | |
| fuz_t | MaxFuzzification (int32_t crisp, const int32_t MIN, const int32_t MAX) |
| Fuzzification. More... | |
| char | FuzzyChar (fuz_t fuz) |
| convert fuzzy variable to ASCII character More... | |
Fuzzy Logic functions.
Fuzzy logic is a design pattern for digital controllers. The key principle is true/false conditions can take on a spectrum of possibilities from definitely true (255) to definitely false (0). For example, a fuzzy logic value of 128 means maybe. Like any controller, a fuzzy logic controller: collects information from input sensors, performs calculations, makes decisions, and affects the system by outputting to actuators. Also similar to other controllers, the goal is to drive the system into a desired state. In a fuzzy logic controller, crisp inputs are the sensor measurements with units, and crisp outputs are the actuator commands with units. A fuzzy membership set is a collection of variables, having values from
true (255,254,253,...,2,1,0) false.
The input membership set defines the status of the system, and the fuzzy values are derived from the sensors. The output membership set defines the status of the actuators, and the values describe what the controller intends to do in order to drive the system into the desired state. More specifically, a fuzzy logic performs these steps:
1) Measurements: collect crisp inputs from sensors.
2) Fuzzification: converts crisp inputs to input fuzzy variables.
3) Fuzzy logic: converts input fuzzy variables to output fuzzy variables.
4) Defuzzification: converts output fuzzy variables to actuator commands, and perform outputs.