Pid rslogix 5000

Join Date
Jan 2013
Location
california
Posts
32
Hello, was wondering if anyone could shoot me some pointers on my first PID loop for controlling temperature for product (bottling manufacture). I would post my file but its to large after being zipped, will try and save as L5 file tomaro if needed.

Hardware: panelview plus 1500, compactlogix, flex IO with Ethernet, analog input and output cards.

So this is the mechanical setup. A pump, pumps product from a batch tank through a heat exchanger to another holding tank, the purpose of this heat exchanger Is just to maintain product temperature at 40F. The cooling is done with glycol. there is a Temp transmitter at the outlet of the heat exchanger to the holding tank on the product side. there is a modulating valve 4-20ma at the inlet of the heat exchanger on the glycol side. The product freeze point is 27F and must not freeze. also the product temperature entering the heat exchanger would be roughly 50F.

Now for the logic I have a PID on a periodic task of 100ms, the PID update time is set to .1 ms. the Proportional is set to 2, the Integral is set to 1. is this a good starting point for this type of application? I have the scaling tab of the PID set for the process variable to match the temperature min and max of the Temp transmitter in F degrees ( I scale the data before I send to PID ) also the same for the engineering units are the same. ( is the setpoint based off of the engineering units min and max? ) the control variable is set to min and max 0 to 30840. the control variable gets moved to the analog output channel via MOV instruction. the reason is if the pump is not running or if the temperature gets too low say 32F I want to move a 0 to the output channel to close the glycol valve. ( is this good practice or is there an alternative way to provide freeze control? my concern is if the valve is constantly slamming shut it might be taxing on the plant glycol system?) I also want to be able to send a setpoint to the PID via HMI and put the PID in manual and give it a percentage of how much for the valve to open for manual control, so do I basically reference the tags in the HMI to the PID control block data. thanks in advance for any input.
 
Hi Industrial951

Your integral (set to 1) looks too short for the sound of your application. Have a look around (on the interweb) for explanations of what effects the three terms (P,I & D) have on the process. This should help you experiment in the right way. There is also several methods (Ziegler nicholls being one) for tuning the system.
 
Hard to recommend PID values - best to calculate using Ziegler Nichols as above if you don't fancy the more traditional method of tuning on site. Even then it is better to have some idea of where to start.

For manual we switch the .SWM tag of the PID box direct from the HMI and then pass a value directly to the .SO tag.

As for preventing freezing that should be prevented by normal operation of the control valve so using the same kit for a fault situation doesn't seem the right approach. Maybe you need a shut down valve for the product with independent temperature sensing as back up if your normal temperature control system has failed. Depends how critical it is and, of course, the budget...!
 
There are so many (cheap) temperature controllers on the market with nice auto tuning functions, that I can't understand why you try to do this from within a PLC...

What you also can do is, connect such a external controller to the system, let it auto tune.
And when finished, read the PID value's. These will be a good starting point for your PLC PID.
 
Now for the logic I have a PID on a periodic task of 100ms, the PID update time is set to .1 ms. the Proportional is set to 2, the Integral is set to 1. is this a good starting point for this type of application?
Yes, and no...
I assume you are using Independent Gains? This is the easier of the PIDs to set up. This way, when you adjust your Proportional constant, it won't adjust the Derivative or Integral terms.
This also means that as your number gets larger, the response will be more pronounced too. So if it isn't reacting fast enough, increase your proportional term.

Then, just turn on your loop and watch the 4-20mA Output, and monitor the Temperature in. I usually make a graph to plot PV vs. Time so I can actually SEE the overshoot and wobble.
Start with T=60F, turn on the loop. Watch it approach T=50F, it will overshoot, then come back towards 50F and overshoot again. Then, it comes down to you and your client "Is this overshoot acceptable? Is T=40F OK? Or should it only overshoot to T=49.5F? How long is OK for it to stabilize at T=50F: 5 minutes, 1 minute, 20 seconds?"
These are all factors of YOUR installation, that we cannot answer.

Increase Proportional = PV will approach SP faster
Increase Integral = reduce the amount of overshoot when PV reaches SP
Increase Derivative = reduce steady state wobble. Be careful with this one though, as it can cause a lot of other grief. Leaving this at 0 is fine for 90% of applications, in my experience.

I have the scaling tab of the PID set for the process variable to match the temperature min and max of the Temp transmitter in F degrees ( I scale the data before I send to PID ) also the same for the engineering units are the same. ( is the setpoint based off of the engineering units min and max? ) the control variable is set to min and max 0 to 30840.
SP uses the same units as PV.
So if your "Unscaled Min/Max" are 0-30840, represents 0-80F (or whatever the range is), you have to scale your SP to represent 50F across the PV range:
0-30840 counts = 0-80F
385.5 counts = 1F
19275 counts = 50F <-- Your SP should be 19275, not 50.

the control variable gets moved to the analog output channel via MOV instruction. the reason is if the pump is not running or if the temperature gets too low say 32F I want to move a 0 to the output channel to close the glycol valve. ( is this good practice or is there an alternative way to provide freeze control? my concern is if the valve is constantly slamming shut it might be taxing on the plant glycol system?)
I have found that this is the best way to do it.
Use an internal register to hold the data for your Analog Out, then as the very last rung in your code, use a MOV to send it to Local:x:O...
This way, you can actually have the PID loop writing to the register, but then you just have your safety rung after the PID, it will force the register to zero.
It's just safer in my experience.

Although, for freeze protection, and closing a glycol line you should take some time to consider:
- What happens when the Glycol system shuts? Can the fluid still flow somewhere? Or will this cause a deadhead in my system?
- What happens if the temperature probe fails and begins to report 4mA, or min-scale? Does your process stop also? Should it stop? Are there other safeties in place for Overtemperature?
There are a lot of other questions that we can't answer for you. This becomes part of understanding the mechanical system. Talk to your client about their thoughts for this.
I also want to be able to send a setpoint to the PID via HMI and put the PID in manual and give it a percentage of how much for the valve to open for manual control, so do I basically reference the tags in the HMI to the PID control block data. thanks in advance for any input.
The .SWM bit, and .SO for your CV value.
Under your PID Setup window, the Configuration Tab, check "PV Tracking"
This means the PID loop will continue calculations while in Manual mode, and allow bumpless transition back to Auto.
 
Thank you all for the replies, with your help I was able to achieve a tolerance of about 1.2 degrees around setpoint, this was acceptable for this application.
 
If you're not intimidated by Function Block programming, I personally prefer using the PIDE instruction as it's simpler to set up and use. The rub is, of course, it's only available as a Function Block instruction.
 

Similar Topics

Hi, Long time not in the forum, and not in the programming. I´m getting back. I was issued a conversion from RSLogix 500 to RSLogix 5000 (studio...
Replies
0
Views
1,289
So I have a PID loop on an 1756-L61 running V17 software just for background. Also the PID PV is a pressure transmitter and the CV is speed sent...
Replies
1
Views
894
Hi All, I have a PID control application that I would like to get your opinions on. As I am reality new to PID loops I am struggling somewhat...
Replies
14
Views
4,283
Hi, I am confuse with the scaling tab on the PID dialog box. On the Process variable I am using a tag that is already scale. 0 to 16 Feet Level...
Replies
2
Views
2,420
Hi I am trying to understand the best method of providing bumpless transfer to the PID function (not PIDE) The existing code shows In Manual...
Replies
10
Views
4,616
Back
Top Bottom