News:

  • September 29, 2026, 09:35:29 PM

Login with username, password and session length

Author Topic: PID to PWM for two outputs  (Read 11870 times)

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
PID to PWM for two outputs
« on: February 14, 2019, 12:03:57 PM »
   I have a very slow moving process which requires two outputs to control a valve.
I am looking into controlling it via a PID loop. I have
realtime feedback from the PV, and my PV can change within about 10-15 minutes
once the valve opens or closes.
   I've already began my testing using a PID instuction in DoMore on the
simulator with a TIMEPROP instuction to change the continous signal to a
Discrete output which works great for one output, in my case I need two outputs.
   So how do I go about controlling two Discrete outputs? Do I use two
seperate PID loops? I've read about BiPolar PID loops, but the PID instruction
only allows 0-100%. I'm in the begining stages so I'll take any and all advice.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: PID to PWM for two outputs
« Reply #1 on: February 14, 2019, 05:58:56 PM »
What is the relationship between the 2 valves?

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
Re: PID to PWM for two outputs
« Reply #2 on: February 14, 2019, 07:16:39 PM »
There is only 1 valve, which can only be controlled by an open or close input.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: PID to PWM for two outputs
« Reply #3 on: February 15, 2019, 10:02:57 AM »
The feedback is the position of the valve?

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
Re: PID to PWM for two outputs
« Reply #4 on: February 15, 2019, 10:24:37 AM »
Sorry, I have position feedback, and level feedback(PV).

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: PID to PWM for two outputs
« Reply #5 on: February 15, 2019, 12:45:55 PM »
Are you trying to keep a constant level in the tank?

Garyhlucas

  • Hero Member
  • *****
  • Posts: 421
Re: PID to PWM for two outputs
« Reply #6 on: February 15, 2019, 02:00:31 PM »
I think you are confusing everyone! My take is you have a valve with one input drives it open and the other drives it closed. You also have an analog position signal that tells you where the valve is currently positioned.

So you want the output of the PID loop to control valve position? Simple to do. Make a stage that asks does valve position match PID output? If too much open jump to close valve stage and drive close and exit on valve position equal to PID and return to Is valve position equal to PID output. If too much closed use a stage to drive it open. In asking the question about position be sure to include a deadband that allows valve position not constantly hunt back and forth.

Add in what you know that the PLC can?t know. Maybe minimum flow needed is always at least 30% open and max is never more than 80%. So limit PID that range of control.

Hope this helps

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
Re: PID to PWM for two outputs
« Reply #7 on: February 15, 2019, 09:52:29 PM »
Sorry for the confusion, I'm terrible at explaining things. You're answer is what I was looking for. I will give it a shot. Thank you for your quick reply