Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Fuzzy Engine in ARM MCU? #2670
    Avataraaron.geier
    Participant

    I was able to get the source code compiling with my embedded compiler.

    The following were three changes required for me to get it compiling:

    1) I needed to add “std::” scoping to a few items for my compiler to be happy [namely std::ext() and std::va_list].
    2) In “Bell.cpp”, my compiler complained that “std::pow” function had multiple matches of the overloaded function, so I changed it to “std::powf” for my application
    3) In “Consequent.cpp” and “Last.cpp” my compiler does not have an operator overload for “!=” on reverse iterators.
    3a) In “Last.cpp” the following block of code it != ruleBlock->rules().rend(); ++it) { changed to (it.base() - 1) != (ruleBlock->rules().rend().base() - 1); ++it) {
    3b) in “Consequent.cpp” the following block of code rit != proposition->hedges.rend(); ++rit) { changed to (rit.base() - 1) != (proposition->hedges.rend().base() - 1); ++rit) {

    My biggest concern are changes that I had to make for item #3 above. Is this the proper way of updating for reverse iterators, or would you suggest an alternative way?

    in reply to: Add Center of Gravity Defuzzification Method #2583
    Avataraaron.geier
    Participant

    Hello,

    Thanks for your explanation. There appears to be something different about what National Instruments is doing, and what everyone else does 🙂 At the end of this post I’ve listed a block of FLL “code” that I’m using. I’ve also linked images to what National Instruments GUI shows.

    When I set the “TestInputVar” to a value of 160, National Instruments says the output variable “TestOutputVar” is 100. When I load the FLL block into FuzzyLiteQt, and set the input value to 160, it says that the output variable “TestOutputVar” is 50. So I’m trying to determine what the difference is and how to overcome that.

    In my example, the output variable ranches from 0 to 100 where 0 would represent 0% of something and 100 would represent 100% of something (perhaps a duty cycle). The input variable ranges from 0-550.

    Engine: TestController
    InputVariable: TestInputVar
    enabled: true
    range: 0.000 549.999
    lock-range: false
    term: AtSetpoint PiShape 298.000 299.000 301.00 302.00
    term: VeryLow Trapezoid 0.000 0.000 260.000 300.00
    term: VeryHigh Trapezoid 300.000 305.000 550.000 550.00
    term: Low PiShape 260.000 300.000 300.000 300.00
    term: High PiShape 300.000 300.000 300.000 305.00
    OutputVariable: TestOutputVar
    enabled: true
    range: 0.000 100.000
    lock-range: false
    aggregation: Maximum
    defuzzifier: Centroid 100
    default: nan
    lock-previous: false
    term: Full Constant 100.000
    term: Medium PiShape 10.000 15.000 30.000 35.000
    term: Off Constant 0.000
    term: High PiShape 15.000 20.000 40.000 45.000
    term: Low PiShape 0.000 5.000 25.000 30.000
    RuleBlock: mamdani
    enabled: true
    conjunction: Minimum
    disjunction: Maximum
    implication: Minimum
    activation: General
    rule: if TestInputVar is AtSetpoint then TestOutputVar is Medium
    rule: if TestInputVar is VeryLow then TestOutputVar is Full
    rule: if TestInputVar is VeryHigh then TestOutputVar is Off
    rule: if TestInputVar is Low then TestOutputVar is High
    rule: if TestInputVar is High then TestOutputVar is Low

    Screenshot 1 of NI Fuzzy Logic Controller:
    NI Screenshot1

    Screenshot 2 of NI Fuzzy Logic Controller:
    NI Screenshot2

    Screenshot 3 of NI Fuzzy Logic Controller:
    NI Screenshot2

    in reply to: Add Center of Gravity Defuzzification Method #2582
    Avataraaron.geier
    Participant

    Hello,

    Thanks for your explanation. There appears to be something different about what National Instruments is doing, and what everyone else does 🙂 At the end of this post I’ve listed a block of FLL “code” that I’m using. I’ve also linked images to what National Instruments GUI shows.

    When I set the “TestInputVar” to a value of 160, National Instruments says the output variable “TestOutputVar” is 100. When I load the FLL block into FuzzyLiteQt, and set the input value to 160, it says that the output variable “TestOutputVar” is 50. So I’m trying to determine what the difference is and how to overcome that.

    In my example, the output variable ranches from 0 to 100 where 0 would represent 0% of something and 100 would represent 100% of something (perhaps a duty cycle). The input variable ranges from 0-550.

    Engine: TestController
    InputVariable: TestInputVar
    enabled: true
    range: 0.000 549.999
    lock-range: false
    term: AtSetpoint PiShape 298.000 299.000 301.00 302.00
    term: VeryLow Trapezoid 0.000 0.000 260.000 300.00
    term: VeryHigh Trapezoid 300.000 305.000 550.000 550.00
    term: Low PiShape 260.000 300.000 300.000 300.00
    term: High PiShape 300.000 300.000 300.000 305.00
    OutputVariable: TestOutputVar
    enabled: true
    range: 0.000 100.000
    lock-range: false
    aggregation: Maximum
    defuzzifier: Centroid 100
    default: nan
    lock-previous: false
    term: Full Constant 100.000
    term: Medium PiShape 10.000 15.000 30.000 35.000
    term: Off Constant 0.000
    term: High PiShape 15.000 20.000 40.000 45.000
    term: Low PiShape 0.000 5.000 25.000 30.000
    RuleBlock: mamdani
    enabled: true
    conjunction: Minimum
    disjunction: Maximum
    implication: Minimum
    activation: General
    rule: if TestInputVar is AtSetpoint then TestOutputVar is Medium
    rule: if TestInputVar is VeryLow then TestOutputVar is Full
    rule: if TestInputVar is VeryHigh then TestOutputVar is Off
    rule: if TestInputVar is Low then TestOutputVar is High
    rule: if TestInputVar is High then TestOutputVar is Low

    Screenshot 1 of NI Fuzzy Logic Controller:
    NI Screenshot 1

    Screenshot 2 of NI Fuzzy Logic Controller:
    NI Screenshot 2

    Screenshot 3 of NI Fuzzy Logic Controller:
    [url=https://flic.kr/p/XuYQ8z]Screenshot3[/url]

Viewing 3 posts - 1 through 3 (of 3 total)