Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
tap::algorithms::FuzzyPDRuleTable Class Reference

#include <fuzzy_pd_rule_table.hpp>

Inheritance diagram for tap::algorithms::FuzzyPDRuleTable:
Collaboration diagram for tap::algorithms::FuzzyPDRuleTable:

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
 

Detailed Description

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.

See also
FuzzyPD

Member Enumeration Documentation

◆ FuzzyMembers

Members associated with membership functions (https://www.mathworks.com/help/fuzzy/trimf.html).

Enumerator

Negative error.

Zero error.

Positive error.

NUM_FUZZY_MEMBERS 

Constructor & Destructor Documentation

◆ FuzzyPDRuleTable() [1/2]

tap::algorithms::FuzzyPDRuleTable::FuzzyPDRuleTable ( )
inline

Default constructor, if default constructor is used the fuzzy rule table will always set the P and D gains to 0.

◆ FuzzyPDRuleTable() [2/2]

tap::algorithms::FuzzyPDRuleTable::FuzzyPDRuleTable ( const std::array< float, NUM_FUZZY_MEMBERS > &  kpParams,
const std::array< float, NUM_FUZZY_MEMBERS > &  kdParams 
)
inline
Parameters
[in]kpParamsA 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]kdParamsA list of possible derivative parameters that are associated with the output of the membership functions.
See also
kpParams for more information.

Member Function Documentation

◆ getFuzzyGains()

modm::Matrix< float, 2, 1 > tap::algorithms::FuzzyPDRuleTable::getFuzzyGains ( ) const
inlineoverridevirtual
See also
FuzzyRuleTable::getFuzzyGains

Implements tap::algorithms::FuzzyRuleTableInterface< 2 >.

◆ performFuzzyUpdate()

modm::Matrix< float, 2, 1 > tap::algorithms::FuzzyPDRuleTable::performFuzzyUpdate ( float  e,
float  d 
)
overridevirtual
See also
FuzzyRuleTable::performFuzzyUpdate

Implements tap::algorithms::FuzzyRuleTableInterface< 2 >.


The documentation for this class was generated from the following files: