PLC-5 PID - Help With Input Scaling?

skyfox

Lifetime Supporting Member
Join Date
Nov 2006
Location
CA
Posts
276
Still trying to get my head around this PID PV input scaling thing.

2nd_PV.JPG


What I am trying to do is to add a 2nd (user selectable PV input to a single PID control with analog inputs with two different input transmitter ranges.

The existing input device range is 0 to 200 RPM.
In the PID config block, original programmer used "O - 8000" for input scaling for this transmitter. How did he arrive at this value?

New transmitter being added is ranged to 0 to 150RPM and connected to the same analog input card. Both inputs are 4-20 ma signals. Now if I allow this 2nd input to go in to existing PID as a selectable PV input, wouldn't my RPM value be totally off because of the current Input scaling inside the PID?

How would I add this transmitter so both would utilize the same PID control block? Do I have to scale the 2nd transmitter via logic before feeding it in to the PID? I dont see any other way to do it. Any calculation help, formulas etc to resolve this would be greatly appreciated.

I would really like to know where the scaled input value of 8000 came from or how it should be calculated. I could not find anything in the data sheets and PLC-% instruction ref. confused me even more.

Thanks.
 
So the instrument scale values you show are for the analog card channel scaling?

Is it possible that was inadvertently changed?

Record the mA value at 0 and 150 rpms (or if that is not possible, use device set up info) Compare that to the analog input channel scaling first. You can do this from the RSLogix5 analog config screen if it is part of your I/O configuration documentation and you have filled in the BTR/BTW info.

Then apply the result to the PID scaling.

Maybe it will make more sense.
 
Thanks for the reply OkiePC,

May be I wasnt clear in my post or I am not understanding your reply. To Start off;

Analog Input #1
4 - 20 Ma
Scaling = 0 - 4095
Device Range = 0 - 200 RPM

4ma = 0 analog input Scale Value = 0 RPM
20ma = 4095 analog input Scale Value = 200 RPM

This is the PV input to the PID. Currently the unit is running with PID Input scaling of 8000 max 0 MinScaling. What determined these values?

Adding a second input to the "SAME" PID so the user can select between Input #1 or #2 as the PV input for the "SAME" PID. This is where I am confused about the "PID INPUT SCALING". I have to use the same value of 0 to 8000 for max/min input scaling in the PID, but sensors reperesent two different RPM ranges but with same analog scaling value of 0 - 4095.

New Sensor Being Added;
Analog Input #2
4 - 20 Ma (Same as Input # 1)
Scaling = 0 - 4095 (Same as Input # 1)
Device Range = 0 - 150 RPM (Analog input #1 is 0 - 200RPM)

4ma = 0 analog input Scale Value = 0 RPM
20ma = 4095 analog input Scale Value = 150 RPM

This is analog input is identical to the first one except instead of being 0 - 200 RPM, this is 0 - 150 RPM.

Both inputs are connected to the same analog (IFF) card and all inputs in that card are scaled 0 to 4095 during block transfer.

Hope this makes sense.

HELP!
 
Greetings skyfox ...



first about that 8000 number ... naturally I can’t say for sure (based on what you’ve posted so far) but here are some guesses that might help answer your question ...



using the original (0 to 200 RPM) input, when your motor speed is running “wide open” at 200 RPM, is there anything in your system that relates to an “8” value? ... for example: maybe 200 RPMs would equate to 80.00 feet per minute ... or maybe 8000 gallons per hour ... or maybe 8 miles per hour ... or maybe 800 inches per minute ... start thinking along those lines and you MIGHT come up with the origin of that “8000” entry ... obviously you might have to insert an “implied decimal” somewhere in that 8000 value - but the concepts that we’re talking about are quite common ... the basic idea is to use a “full scale” number which will relate somehow to a realistic value for an operator to read and understand ... this MIGHT be what the original programmer had in mind ... notice that in your screen shot, the setpoint has been entered as 4000 ... this is an obvious attempt to have the PID control the system at 50% of “full throttle” ... (we’ll pass over the point that the PID was in the manual mode when the shot was made) ...



now about the scaling ... notice that your new analog input (0 to 150) is related to the old analog input (0 to 200) by a factor of 0.75 ... keeping that in mind should make the effect of the following rungs fairly obvious ...



skyscale1.JPG





to continue the discussion, let’s start with a few assumptions (gosh I hate that word) ... first let’s assume that your old input gives “good” control ... now (for some reason not stated) you’ve decided to occasionally use a new input - one with a lower range ... and so, the main objective is (as you’ve already guessed) to have the PID “look at” the new signal in the same range of values as it used to interpret the old signal ... in other words, 50 RPM (for example) from the new transmitter should be interpreted exactly the same as 50 RPM from the old transmitter ... if I understand your questions correctly, then the rungs above should help get the job done ...



now ... whether this method of supplying the “new” input signal to the PV is going to have the effect that you desire still remains to be seen ... but (if my assumptions are correct) then the rungs I’ve shown should cause the PID to accept either analog input as a properly scaled PV signal ...



one more (minor) thing ... you keep mentioning “0 to 4096” as your analog value range ... in most cases, this should be “0 to 4095” ... in most cases that one data point is NOT going to amount to anything worth talking about - but I’m just wondering where/why you came up with the 4096 value ...
 
Greetings Ron,

Thank you so much for that detailed explanation. Your assumptions were all correct. 0 to 4096 was a mistake and should have been 4095.

Suppose sensors were ranged (not RPM but some other type);

(-8 to +8 and -4 to +4) or (-4 to +4 and -4 to +8). should there be a need to add a offset as well at some point? Not sure about the math/formula portion of this.

About the 8000 number. If I understand you correctly, is the input scaling in a PID used used for some type of engineering unit conversion? Couldn't the original programmer have used 0 to 80 instead of 0 to 8000 for input scaling in the pid as well? Why not 0 to 10000 instead of 8000? Thats what I am trying to get my head around. I am much more in the clear about this now than I was 2weeks ago thanks to your explanation.

Much appreciated.

Best Regards
 
Last edited:
Greetings skyfox ...



About the factor of 0.75 - How did you arrive at that number?



150 divided by 200 equals 0.75 ... since both ranges (fortuitously) start at 0, then the relationship is a simple ratio ...

Suppose sensors were ranged (not RPM but some other type);

(-
8 to +8 and -4 to +4) or (-4 to +4 and -4 to +8). should there be a need to add a offset as well at some point? Not sure about the math/formula portion of this.




as long as the values are “linear” (and can be represented by a straight line on a piece of graph paper) then the famous formula y=mx+b is usually the ticket to solving the math ... if you need more detail, just click the link below my signature and navigate to the “Sample Lessons” section of my website ... the two “Scaling” lessons should answer all of your questions along those lines ... if not, feel free to post again and ask specific questions ... there are many people here on the forum who can help ...

About the 8000 number. If I understand you correctly, is the input scaling in a PID used for some type of engineering unit conversion?



probably - sort of ... internally the type of PID that you’re using always works on integer values in the range of 0 to 4095 ... when we use scaling (such as your 0 to 8000) it’s an effort to make things easier on the humans involved with the system ... specifically, internally the PID is still doing the math operations based on the old 0 to 4095 range of integer values - but using the “setpoint scaling” feature can often make things easier on the operators and technicians ... side note: many programmers always leave the setpoint “unscaled” (at 0 to 4095) and do all of the “human-type” scaling in the ladder logic using various math functions ... the actual control of the process should be just as “good” one way or the other ...



Couldn't the original programmer have used 0 to 80 instead of 0 to 8000 for input scaling in the pid as well.



yes ... but since the type of PID that you’re using is “integer” based, a range of 0 to 80 would force the operator to use only 80 “steps” of resolution ... analogy: your bank decides to give up on “pocket change” ... now you might have 47 dollars in your account - but you can’t have 47 dollars and 33 cents ... back to your control system ... suppose that your operator wants a setpoint which is a little bit more than 47 - but not quite as much as 48 ... in an integer-based system, using just 0 to 80 won’t accommodate a number like 47.33 ... but using 0 to 8000 would ... the equivalent value would be 4733 - with two decimal places implied ... in many systems, the implied decimal places are often nailed down at the operator’s interface (HMI/MMI/SCADA) device ... PanelViews, etc. are sometimes programmed to handle this ...



Why not 0 to 10000 instead of 8000?



have you looked for that “8” based relationship that I mentioned? ... that might be the answer ... if 200 RPM happens to equate to 80 feet per minute, what sense would it make to use 10000? ... that would tend to confuse the operator - not make his life simpler ...



I am much more in the clear about this now than I was 2 weeks ago thanks to your explanation.



well, it took me MUCH longer than two weeks to get to where I sort-of-kind-of understand this stuff (and I’ve still got a long way to go) ... glad to know that I’ve been able to help ...
 
Last edited:

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,799
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,888
Dear Friends, i am using Siemens S7200 PLC. my project is i have to control VFD through PID. i made the program and also it works...
Replies
0
Views
1,555
dear all: we have a automated vehicle which runs on a magnetic tape. we are taking analog input [0 to 10] volts from a reader this has a...
Replies
3
Views
3,664
Hi fellas, I have a Mitsubishi Q02 PLC and i need to setup a PID loop. I have downloaded the manual from mitsubishi and used there programming...
Replies
3
Views
2,559
Back
Top Bottom