Need help with PID control please!

The PID instruction has a build-in "SCP" instruction.

What that means is if you put values of 0-32767 for the "input Range Maximum" and "Input Range Minimum" it will be scaled to whatever is enter into the "Engineering Unit Maximum" and Engineering Unit Minimum". In your case 0-100. The result of this scaling is displayed as the Process Variable status value. And then used to calulate the error vs the setpoint for control.

14049/32767= .4287

.4287*100= 42.87 deg

Save the program and post it here when the error occurs.

Please see pdf below about loop update time, your program updates the PID instruction every scan but the "Loop Update Time" is set for 2 sec.
 
Last edited:
However when I put the PID in auto is does not update the Process variable in the PID setup screen menu as well as the process error. So when I put the PID in auto the process variable does not move at all.
If it was reading the process temperature at one time in Auto mode, then something has broken - maybe the temperature transmitter has failed, or the cable is disconnected or broken.
Edit** I can see the value of N46:7 on wonderware just fine, its showing 43 degrees. N46:7 is the address used in the PID's process variable, that's why I don't understand why it wont update or register the correct number. If I use PD80:5.PV as the readout on wonderware its the same issue whether in auto or manual it does not update, its just stays at 40 and doesn't move even though you can see the value of N46:7 changing.
That shines a different light on the problem. There has to be a setup or programming error somewhere. Perhaps your PID PV is being written to by two different places - maybe the HMI is trying to set that value, as well as your transmitter temperature input. The last one in the prograrm wins the race. Find where that constant "40" is coming from and that is probably the source of the error.

I tried to use N25:1 as PD80:5's Process Variable and it just wouldn't work.
Some other part of your program must be overwriting this word. Sometimes programmers forget that the RSLogix5 PID Control Block requires 81 words of space, unlike RSLogix500 which needs only 23 words.
 
Last edited:
Lancie1, the OP's problem is how the PID and analog input card are setup together. See my post #16 for how to setup the PID instruction. I will add to that, the analog card needs to be setup for 0-32767 raw data ( best resolution) and the problem will be solved.

If you look at how the OP setup the PID instruction post#1 and how the analog card is setup (program OP posted) the process variable would never be lower the 40 or greater the 41.8.
 
If you look at how the OP setup the PID instruction post#1 and how the analog card is setup (program OP posted)
I can't open his program, so I should not even be entereing a dog in this race.
 
Ok so I Put the 2 second timer in for the PID control an I changed the MAXI to 100 and left the MINI at 0. I made another rung with a MOV function to move the data from N46:7 to N25:1 just so you could see what the data on the Temperature Transmitter was saying. I've already confirmed with the instrument mechanic's that the TT is working fine. The process variable in the PID is just at 0.085 and not changing at all. I tried yesterday to look for anything that could be writing to N46:7 but I couldn't. Also if something was writing to it and changing its value I would be able to see it the in the MOV function where I moved the data to N25:1. But instead its reading 43 degrees just fine on the MOV which shows me nothings writing to it. This is getting to be quite the problem. I made another copy of the Program and attached it. Have a look and see if there is anything that sticks out to you

Edit** also when I tried using another temp transmitter that's close to the other one in the field which reads out at 48 degrees on the W.W. HMI. Its scaled from 0 to 32767 in I/O config so I put that one as the Process variable for PD80:5. The Process variable does update but it reads out as 31 degrees even though the scaling values are MAXI-32767 MINI -0 and the raw data is 158069 and MAXS-100 MINS-0. This is odd that the PID is cutting a percentage of the Raw data coming in. So I used N46:7 again but scaled it to 0-32767 in I/O config instead of 0-100 and the same thing its reading 28 degrees even though the raw data is 14136. I don't understand why its choosing not to use the correct raw data number. Only the PID is having issues with the raw data. Every where else its reading fine. I'm almost temped to delete that PD block and make a new one!
 
Last edited:
Here's the program again with the Changes as per scaling 0-32767 in I/O config and it reading 28 instead of 43. For some reason the PID is reading a value of 9200 in raw data instead of 14130, where is this loss of 5000 raw data? atleast its updating now though, lol
 
Change the timer's done it instruction on rung 069 to a "XIC" instead of an "XIO see picture. Then take another snap shot of your program.

Where are you seeing 9200?

Check the stability of your analog input. In the program you sent the raw data is 14247.

xicinsteadofxio.png
 
Last edited:
I didn't actually see the value 9200 of raw data I just know that's what the PID is using since (N46:7|32767)*100 so (9200|32767)*100 equals 28 degrees, when it should be using (14130|32767)*100 equalling 43 degrees and the correct scaled number.
 
I didn't actually see the value 9200 of raw data I just know that's what the PID is using since (N46:7|32767)*100 so (9200|32767)*100 equals 28 degrees, when it should be using (14130|32767)*100 equalling 43 degrees and the correct scaled number.

After changing the scaling parameters did you re-initialize the PD block?

untitled.jpg
 
Try changing the loop update time to .5 sec and your timer preset to 50 (.5 sec).
Did you monitor the raw data value to see if it is steady. The PID instruction is only going to update its PD80:5.PV value every time is is scanned. Set at 2 sec now, try it at .5 sec.
 
I was just curious;

Previously, the range of values you could enter in the MMI as setpoint was, 40 - 100? Now 0-100?

MAXS & MINS = SETPOINT scaling engineering units? i.e. previously 40 - 100?

Rung 66 used to write PD80:5.MINS (was 40), (which is now Zero), to PD80:5.SP (set point) on First Scan.

Is the PID PV updating now? Is the PV correct?

Most of the other PID's in the program use PD(#).EN, do they update their PV's on the PID status tab?
 
MAXS & MINS are used as limits for SP entry in PID Auto mode. The new low limit (MINS) is 0. See last instr., rung 71.
The First Scan (rung 66) and limits (rung 71) are the reason MINS was originally 40?
 
Before the MIN-S was 40 apparently because the operator was not allowed to have a temperature lower than 40 degrees as a setpoint. That was because the other Temperature Transmitter was closer to the standpipe and the readout was higher than the new TT because its way further out and the pulp has time to cool by then. So the operator can have a little lower than 40 as a setpoint. I tried changing the timer to .5 seconds and it didn't help any. I even matched the update time with the timer to try that too. As of right now with the process variable is reading .08 even though it should be reading 40. I don't know how to re-initialize the PD block, never done that before. I saved the program and uploaded its current saved state.

I think I'm going to just give the operator a temporary template on W.W. so he can control the valve output and have a readout straight from the I/O so he can control the valve according to the temperature manually. While they use that I'm going to program a new PID block and give that a try
 

Similar Topics

hello guys I'm having problem in pid in Omron cp1l plc I have program . I'm getting alarm when I execute pid
Replies
1
Views
2,812
I currently have a pressure switch and a back pressure regulator. I am planning to replace the regulator with an E/P electronic-pneumatic...
Replies
9
Views
4,409
I just programmed a PID control system for a VFD to control header pressure for our weak liquor pump to our evaporators. I tested out all the...
Replies
4
Views
1,902
Hello, I'm an intern at this power plant and I'm new to PLC programming. I'm hoping to get some help from the professionals in this forum. I...
Replies
22
Views
5,938
I am working on a CIP project. There is a tank which is about 1500L. We need to keep the water volumn inside the tank to be SP:200L. The control...
Replies
17
Views
10,855
Back
Top Bottom