Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Fuzzy Logic PID Controller

truly-bent
2019-02-15
7 days ago
  • truly-bent - 2019-02-15

    Having more than a few grey hairs from tuning PID loops in my time, I was excited to read how Fuzzy Logic is capable of modifying PID parameters dynamically.

    Having recently translated the eFFL library (), this seemed like a good test for both the library and my ability to use it. The result is posted here: . It seems to work as advertised, although i haven't used it in the field yet.

    The controller has 2 crisp inputs, error (E = r(t)-c(t)) and error rate of change (Ec = de/dt). Each of these inputs is divided into 7 fuzzy sets; the resulting matrix requiring (7x7) 49 rules to cover. There are 3 crisp outputs, Kp, Ki, and Kd, as you'd expect.

    The documentation that this project is based on is included in the /Docs section. Note the licensing remains open source.

    EDIT: Added a 'Rules Fired' count to the visualization text display (Fuzzy_eFFL_PID_011.project)
    EDIT: Updated with integrated PID controller -->

     
  • RoryLDM - 2019-02-28

    Oh wow. I'm going to see if I can put this to the test. Thank you.

    Do you have a PID module that you recommend? I have seen the FB in the Oscat Basic library. Mostly I've just used the basic PI function blocks or relied on my VFD's built in PID system.

     
  • gatto

    gatto - 2019-03-05

    Hi,
    try to open Fuzzy_eFFL_PID_011.project
    but says: it can not be opened.
    I'm on Codeys 3.5.10.5. Maybe your project has a higher version.
    Can you save / export it for me in a convenient version?
    Thank you

     
  • truly-bent - 2019-03-18

    @RoryLDM;
    https://github.com/geekfactory/PID

    Note that the PID output has been limited to between -10.0 and 10.0. These values can be found in the PID_GVL globals. You can scale this to whatever your analog output requires. The original C code looks like it was intended for for micros and had an output range of 0 to 255.

    @gatto;
    I did export the original library to V3.5 SP10. Find this in the ../Old directory.

    Find the latest revision here --> https://1drv.ms/f/s!AgeXD5P3kwJIg3Sbvn0Zj2gu88qY (Fuzzy_eFFL_PID_020 (V3.5 SP13).project).

    Have fun peeps!

     
    • sean-barton - 2022-02-18

      I just found this thread (3 years later) and am wondering if the project is still available?

       
  • RoryLDM - 2019-03-28

    Thanks guy. I'll see about re-purposing some solid state relays and heaters.

     

Log in to post a comment.