|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <fuzzy_pd_rule_table.hpp>


Public Types | |
| enum | FuzzyMembers { N = 0 , Z , P , NUM_FUZZY_MEMBERS } |
Public Member Functions | |
| FuzzyPDRuleTable () | |
| FuzzyPDRuleTable (const std::array< float, NUM_FUZZY_MEMBERS > &kpParams, const std::array< float, NUM_FUZZY_MEMBERS > &kdParams) | |
| modm::Matrix< float, 2, 1 > | performFuzzyUpdate (float e, float d) override |
| modm::Matrix< float, 2, 1 > | getFuzzyGains () const override |
Rule table that specifically updates the proportional and derivative gains of a PD controller.
For more general information about fuzzy PID, refer to this paper: https://ieeexplore.ieee.org/document/937407. You can also find others online. This is slightly different than what is described in the paper.
Uses a fuzzy table with 3 fuzzy members (either negative, zero, or positive). Membership functions are triangular to make math easy. Since the table is computing 2 values, the FuzzyRuleTableInterface is instantiated with the OUTPUTS template parameter set to 2.
Members associated with membership functions (https://www.mathworks.com/help/fuzzy/trimf.html).
| Enumerator | |
|---|---|
| N | Negative error. |
| Z | Zero error. |
| P | Positive error. |
| NUM_FUZZY_MEMBERS | |
|
inline |
Default constructor, if default constructor is used the fuzzy rule table will always set the P and D gains to 0.
|
inline |
| [in] | kpParams | A list of possible proportional parameters that are associated with the output of the membership functions. Should be monotonmically increasing. For example, when the fuzzy rule table measures the fuzzy state to be mostly in the location where there is 0 error and 0 error derivative, the "small" proportional gain will be mostly used since the proportional gain doesn't have to be as large. |
| [in] | kdParams | A list of possible derivative parameters that are associated with the output of the membership functions. |
|
inlineoverridevirtual |
Implements tap::algorithms::FuzzyRuleTableInterface< 2 >.
|
overridevirtual |
Implements tap::algorithms::FuzzyRuleTableInterface< 2 >.