Class FuzzyPDRuleTable

Inheritance Relationships

Base Type

Class Documentation

class FuzzyPDRuleTable : public tap::algorithms::FuzzyRuleTableInterface<2>

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

Public Types

enum FuzzyMembers

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

Values:

enumerator N

Negative error.

enumerator Z

Zero error.

enumerator P

Positive error.

enumerator NUM_FUZZY_MEMBERS

Public Functions

inline FuzzyPDRuleTable()

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

inline FuzzyPDRuleTable(const std::array<float, NUM_FUZZY_MEMBERS> &kpParams, const std::array<float, NUM_FUZZY_MEMBERS> &kdParams)

See also

kpParams for more information.

Parameters:
  • kpParams[in] 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.

  • kdParams[in] A list of possible derivative parameters that are associated with the output of the membership functions.

virtual modm::Matrix<float, 2, 1> performFuzzyUpdate(float e, float d) override

See also

FuzzyRuleTable::performFuzzyUpdate

inline virtual modm::Matrix<float, 2, 1> getFuzzyGains() const override

See also

FuzzyRuleTable::getFuzzyGains