new to PID, have micro1500 project

g.robert

Lifetime Supporting Member
Join Date
Aug 2003
Location
texas
Posts
320
Hello fellas.

I am trying to wrap up a project this weekend. I missunderstood the desired concept for an analog valve.

I set up a rung that would move a set value to the analog output. Once it reached a set point (read by a 4-20ma level transmitter) it would go back to direct proportional control from that transmitter.

I now know I need to use PID control.I have never done that.I need to set a target value that the valve will open or close to try to reach and sustain that level.

I have very little time and the help on the SLC instructions leave some to be desired.

I have reached as far as inserting a PID function and opening the setup box. I don't know what values to enter. I see from another post that someone else is looking into similar app. I looked at those links and while it helps me understand PID better, I could use more help specific to setting it up in my AB micro 1500.

Thanks in advance for any help in shortening my steep learning curve.


1283 pid.jpg
 
Robert,

this is a bare bones crash course ... I'm sure that you realize that there is a lot more to it than this but this might help get you started ...

pick a data file number that you’re not already using (example: suppose that you have NO data file number 10 in your program) ... in the PID instruction for the “PID file”, enter PD10:0 ... note that the "10" in the address is the number of the previously unused file ...

in the PID instruction for the “Process Variable”, enter the address of the analog input (example: I:2.0) ... check the configuration of your analog input module and make sure that it is “scaled for PID” ...

in the PID instruction for the “Control Variable”, enter the address of the analog output (example: O:2.0) ... check the configuration of your analog output module and make sure that it is “scaled for PID” ...

on the PID setup screen ... first put a “1” in the “RG” bit box at the far right (this gives you an extra digit for the “Controller Gain Kc” and for the “Reset Ti” settings) ...

for “Controller Gain Kc” enter “1.00” (actually you enter “100” and the decimal is automatically entered – this will be true for other settings too) ... note: the value "1.00" is just a "let's get started" shot-in-the-dark guess ...

for “Reset Ti” enter “0.50” ... note: this value is also just a guess ...

for “Loop Update” enter “0.50” ...

for “Time Mode” enter “TIMED” ...

for “Setpoint MAX(Smax)” enter the maximum value (in engineering units) for your process (example: if you’re trying to control the level in a 250 gallon tank, then you would enter “250” here) ...

for “Setpoint MIN(Smin)” enter the minimum value (in engineering units) for your process (example: if you’re trying to control the level in a 250 gallon tank, then you would enter “0” here) ...

for “Scaled Set Point SPS” enter the desired value for your process (example: if you’re trying to control the level in a 250 gallon tank, and you want the level to stay at 150 gallons, then you would enter “150” here) ...

leave all of the other settings alone for now ...

now disable all other rungs that could possibly be controlling your analog output (example: that MOV rung at the top of your posted program) ...

cross your fingers and try the PID ... it should try to control the process by increasing and decreasing the analog output ...

IMPORTANT ... if the output goes in the wrong direction (in other words if the valve closes when it should open) then go back to the PID setup screen and change the “Control Mode” to “E=PV-SP” ...

if you’re lucky, you should now have SOME degree of control ... BUT ... now you have to “tune” the PID for the characteristics of your specific process ... if I were you (and had your deadline and little or no experience with PID tuning), I’d stick solely to making changes to “Controller Gain Kc” and “Reset Ti” ... save the other settings on the PID setup screen for another day ... there are MANY posts on the forum about PID tuning if you need help ... I'll be offline until tomorrow morning but if you'll post a "trend" graph of your results, I'm sure that someone will drop by to give you a hand ...

disclaimer: it’s been quite awhile since I’ve set up a PID for a MicroLogix 1500 ... this has been written from memory ... sorry if I’ve dropped a stitch here or there but I hope that this will be enough to get you going ... I might have been able to be more specific if you had given more details about your process and the hardware that you’re using ...

hope this helps ...
 
Last edited:
Thanks Ron. That is exactly the type of info I could have hoped for at best. I am on it now!

FYI, I have a 1764-28bxb processor with the 1769-if4xof2 analog card.
Off the top of my head, I don't remember any PID setting in the config of that 1769 card but I will find out soon. Does any of this info change previous reply?
 
I just took a quick look at the manual for the module you mentioned ... it looks like you do NOT have the ability to "scale for PID" with this one ...

user manual for 1769-IF4XOF2

from page 4-15:
Unlike the 1769-IF4 and 1769OF2, on-board scaling is not provided by the module. You must do this via your control program.

I'll post more later when I get a chance ...
 
Robert,

Most of the Allen-Bradley analog output cards are now software-configurable, as opposed to DIP switches on the module. You set the operating parameters by sending a number to the "Input Address" of an Output card! It sounds crazy: who would think that an Output module could be changed by sending data to an Input address? However in practice it works pretty well, as each card (whether it be Input or Output type) has space for both memory types reserved in PLC memory. There are details in the Allen-Bradley Analog I/O manuals.

Scaling is a tough issue. Somehow, no matter how I configure the Analog module, I always wind up doing external scaling and also scaling my input variables so that they are in the PID block Integer range of 0-16383. Any other method always winds up causing me problems of one kind or another.
 
Last edited:
Well now I am little lost again. This is what I had up until Rons reply. I will work with it until I get it. Any steps to expedite process are greatly appreciated.

pid-1283.jpg
 
in the same manual I linked above on pages 4-14 and 4-15 are two charts that you'll need to consult ... since your module won't do onboard scaling, most programmers would use two SCP (Scale With Parameters) instructions to handle the math ... most programmers would place the SCP for the input above the PID and place the SCP for the output below the PID ... basic idea: you need to scale the input signal (PV) and the output signal (CV) to range in value from 0 to 16383 ... the PID expects and works best with that range of values ... if you'll tell us what type of process (example: tank level control) and what type of transmitters (example: 4 to 20 mA) and how that correlates with your field indications (example: 4 mA = tank empty ... 20 mA = tank full at 250 gallons) then we can help you set up the SCP's (if you need help) ...
 
and another VERY IMPORTANT thing ... since your module won't automatically scale the PV and CV signals, you're going to need two new integer locations ... suggestion: use N11:0 for the PV and N11:1 for the CV ... so the first SCP will have I:2.0 as its "input" and N11:0 as its "output" ... the second SCP will have N11:1 as its "input" and O:2.0 as its "output" ...

then change the PID so that the Process Variable is looking at N11:0 ... and the Control Variable is sending its signal to N11:1 ...

finally, if you need help with the SCP's, give us that information about your process and transmitter set ups and we're almost there ...

and then to tune the durn thing ...

PS ... sorry this is turning out so sketchy ... I'm working on "boss man's money making stuff" in between posts ...
 
Last edited:
Ron no apologies needed. Thank you for your help.

I allready have some SCP for the input and output in another part of the program. I took the raw input 4-20 ma and set up address where display is read as 4-20 (not the 0-3200?). I did the same for the output.

I assume that I can work off those scp addresses. I definitely have info to work with (as I was lost before). I am not out of the woods yet. I will get as close as I can then post the result.

FYI, all I was required to do up to this point was take the input and display it as 4-20. Then we had to enter a desired 4-20 set point for the output to go to. I did not have to do additional scaling to level, gpm, flow rate etc.
 
I think we're getting closer ...

you said:

I assume that I can work off those scp addresses.

the addresses need to be scaled from 0 to 16383 in order for the PID to give good results ...

specifically ... the PV signal coming into the PID must be scaled from 0 to 16383 ... not 4 to 20 ... not 0 to 250 ... not anything else ... just 0 to 16383 ... the PID is expecting this range ... anything else will give less than optimal results ...

also ... the CV signal coming out of the PID will be scaled from 0 to 16383 (you have no control over that particular range ... that's the way the PID always works) ... so you will need to do some type of scaling to get that 0 to 16383 signal ready to present to your analog output module ... specifically, your analog module will not handle a 0 to 16383 signal correctly ... so that's where the scaling part comes in ...

so how's that deadline issue? ...
 
I better throw this in too..

When I get this program revised I will have to go to the plant and tune it.

Here is the rub: The 4-20 valve that must control the level which is read via the 4-20 transmiter is not going to be able to actually control the level now. It cannot be supplied as it will in the field.

What I mean is we will control the water level to the level transmitter through a manual test valve, not the actual proportional valve.
Can we get control by tuning this way? There will be a 4-20 signal from the transmitter.
When the program sees that this level is above or below set point, I assume we will see valve start to move to adjust level. We would then manually raise and lower the level to see if the valve followed trying to adjust properly.

Our saving grace is this is not a precise application. We just need to keep a level at an area of around 2-3 feet in a tank that has a total level say 16 feet. Do you see any major problems?
 
Ron help..

I got a little confused again. This is where I am at:

I took my existing scaled input @ F8:5 which is set at 0 to 100% off the 4-20ma input.

I scaled per our conversation @ 0 to 16383 and moved to PID process variable.

My set points in PID set up are at 0 to 100 but I am sending it 0 to 16383. My scaled set point is 40 for percentage. Is everything correct but I needed a different address that would take the 40% desired scaled set point and convert to 0 to 16383 then move to scaled set point?

I'm @ the office if you would rather call. If you don't have the time that is fully understood.

pid-1283-2.jpg
 
Well I'm stuck again. Everything is finished but I have one error and I don't know why. I have a output from my PID. It should be a value of 0 to 16383. I scaled it to the desired output of 6553 to 31104.

I'm thinking when input sees 0 give me 6553. When input sees 31104 give me 6553. What am I doing wrong?

Thanks in advance for any help..

pid-1283-4.jpg
 

Similar Topics

I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
8
Views
226
Hi all, I'm having trouble solving a problem I've been working on for several months, and thought you might like a stab at it. The machine runs...
Replies
22
Views
851
How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
386
I'm setting up a PID for a 50hp RO pump in a water treatment plant. When I go to manual mode on hmi I set the swm bit, I also ons the pid output%...
Replies
5
Views
524
I am setting up control for Hypochlorite dosing. The easy part is the dosing calculation for flow pacing but I would also like to setup trimming...
Replies
8
Views
896
Back
Top Bottom