Autor Thema: Bug in FT_PID  (Gelesen 250 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

Offline dfreiberger

  • Newbie
  • *
  • Beiträge: 1
    • Profil anzeigen
Bug in FT_PID
« am: 01. Juli 2020, 03:00:42 »
I believe there is a bug in FT_PID. If the TN value was previously not 0, and then is set to 0, it does not reset the the integral term and keeps accumulating if IEN was previously true. This causes unexpected behavior as the control output continues to grow over time even though the integral term is disabled.

Is the intent instead that RST should be TRUE if TN = 0 so that it will clear the integral term?

IF TN > 0.0 THEN
  integ(IN := IN, K := 1.0 / TN, RUN := IEN, RST := RST, OUT_MIN := ILIM_L, OUT_MAX := ILIM_H);
  integ(RST := FALSE);

I also filed a bug report in

I can propose a bug fix to the github project if that is the appropriate place to do it.

Edit: I have proposed the change in . I believe this will cause no adverse effects as the integral term will always be set to 0 if TN is 0. I realize there is an IEN input which could be used to turn off the Integral term, however in my case I would prefer to just set the Tn constant to 0 and achieve the same thing (realizing that mathematically this makes no sense given it is a divide by zero). If others don't agree, then an alternative approach would be to provide some error indication when the TN term is 0 so that the user is aware that the function block will not behave.
« Letzte Änderung: 01. Juli 2020, 04:00:41 von dfreiberger »