News:

  • August 15, 2026, 04:20:41 AM

Login with username, password and session length

Author Topic: PID Mode not changing  (Read 10930 times)

ksasikumar

  • Full Member
  • ***
  • Posts: 33
PID Mode not changing
« on: April 06, 2023, 05:50:46 PM »
Hello! I am using a few PID loops to control temperature in a room. When the temperature is below a setpoint, the Heating PID is enabled. When the temperature is above the setpoint, the Cooling PID is enabled. I have been running into an issue where the PID mode does NOT change from Auto to Manual when the PID is no longer enabled. Basically, the rung with the PID instruction is no longer energized, but the PID mode stays in Auto mode instead of changing to Manual mode. Does anyone know what could be causing this? Is there any way to force the PID mode to turn off/on?

rlp122

  • Sr. Member
  • ****
  • Posts: 92
Re: PID Mode not changing
« Reply #1 on: April 06, 2023, 07:23:23 PM »
You really need to read the help topic on PID operations if you haven't already.  Most of this is answered there.

ksasikumar

  • Full Member
  • ***
  • Posts: 33
Re: PID Mode not changing
« Reply #2 on: April 07, 2023, 09:21:01 AM »
I have read the help topic. That's why I'm here. This is what the help topic says about Auto/Manual mode:
"The PID Loop's mode (Auto or Manual) is controlled by the power-flow of the PID instruction's single ladder logic input labeled (A/M) (Auto mode / Manual mode).

If the input logic is ON, the PID instruction is enabled and the loop's Mode is set to Auto. In Auto mode the loop runs the PID calculation to generate new .Output value every Sample Time interval.

If the input is OFF, the loop's Mode is set to Manual. In Manual mode the loop IS NOT running the PID calculation, meaning the .Output value remains unchanged by the loop. While the PID loop is in Manual mode it is expected that an operator or other intelligent source is manually controlling the output by observing the PV and writing data to .Output as necessary to keep the process under control."

So my question is why is the PID instruction enabled (Auto Mode) if the input logic is OFF?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: PID Mode not changing
« Reply #3 on: April 07, 2023, 12:36:16 PM »
Looks like your PID instruction is in a stage. I'd wager that the stage is disabled, so the instruction isn't being executed.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ksasikumar

  • Full Member
  • ***
  • Posts: 33
Re: PID Mode not changing
« Reply #4 on: April 07, 2023, 01:10:13 PM »
Yes I am using stage programming. But the stage is not enabled, the input logic is off, but the PID is still in Auto mode.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: PID Mode not changing
« Reply #5 on: April 07, 2023, 01:18:25 PM »
Yes I am using stage programming. But the stage is not enabled, the input logic is off, but the PID is still in Auto mode.

Right, that's what I'm explaining. When the stage is off, the code contained in the stage isn't executed, meaning, the PID instruction never runs, auto or manual. For the PID instruction to function correctly it must be in a stage or code block that is running every scan.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: PID Mode not changing
« Reply #6 on: April 07, 2023, 01:26:35 PM »
And maybe this wasn't clear, but when the instruction doesn't run, the structure state is never updated. It says "Auto" because that's what it was last time the instruction was executed.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ksasikumar

  • Full Member
  • ***
  • Posts: 33
Re: PID Mode not changing
« Reply #7 on: April 11, 2023, 03:55:02 PM »
I see. I added a delay to make sure the PID was in Manual mode before exiting a stage. Thank you!

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: PID Mode not changing
« Reply #8 on: April 12, 2023, 02:27:01 PM »
I see. I added a delay to make sure the PID was in Manual mode before exiting a stage. Thank you!
Rather than use a timer, use the .Mode bit.  If will be ON if in Auto, OFF if in Manual.  So just do a NC contact of the .Mode bit to JMP (i.e. JMP once it's in Manual, in addition to whatever other condition you were testing to JMP other than the timer)

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: PID Mode not changing
« Reply #9 on: April 12, 2023, 05:21:19 PM »
Why two separate PIDs for heating and cooling instead of splitting the CV from one PID into heating, cooling and probably deadband ranges?    Need different gains I assume?
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Kristjan

  • Sr. Member
  • ****
  • Posts: 87
    • Idnadartaekni ehf
Re: PID Mode not changing
« Reply #10 on: April 13, 2023, 11:11:34 AM »
Just adding to Control Guy's comment:
Have you tried the LERP instruction? You can use a couple of those to split the loop's output into two physical outputs. I always cheer when I get the opportunity to LERP  :D