A
I tried to get a answer to these questions on the RSLogix forum, and got NOTHING. My mistake for not going to the real experts first. I've programmed PLC-5s and SLCs for many years, and have used PID blocks successfully in many applications. Yet I've always felt uneasy in using them, as I don't understand their subtleties, or why they do what they do. I've looked through the help files, but they tell you to put data in the fields, but they don't explain the relationships between the feilds, or what the data is supposed to "look like". I've looked through the manuals, and they explain PID theory, but don't explain how to apply the theory to the PID block. I've tried the examples. I CAN make them work. But.... I've catagorized my questions, and I'm even pretty sure I know the answers to some of them (but am asking them anyway as a confirmation). =============== ENABLING The loops can be either in an STI block, or be enabled periodically with a timer. A. How can you determine which method to used? (This one the help files are pretty clear on, when taken together). Per RSLogix500.hlp: "...processor scan time should be at least ten times faster than the loop update time...". What is 'loop update time' here - natural frequency of the loop. I/O update time? AO device movement time? (from 0 to 100%; from 50 to 51%)? Per RSLogix5.hlp: "Enter an update time... at 1/5 to 1/10 the natural period of the load (load time constant).... Periodically enable the PID instruction at a constant interval equal to the update time. When the program scan time is close to the required update time, use an STI to ensure a constant update interval." B. Are the following the "correct" method of programming the PID rung in each case: STI: MUL S:30 0.001 PD30:0.UPD PID PD30:0 AI_PV AI_TIE AO_CV OTU PD30:0.EN (this rung is in the N: file example, but not the PD: file example - is it even needed ?) Timer: XIO T4:0.DN TON T4:0 1 10 0 MOV T4:0.PRE PD30.0.UPD XIC T4:0.DN PID PD30:0 AI_PV AI_TIE AO_CV C. How do you handle the situation where you have more than one PID block which require STI, but they have different periods? D. What is the "best" method for 'disabling' a PID ? 1) Put an XIC bit on the PID block branch to enable. 2) Set the PID manual mode bit (SWM? MAN?) and set the .SO value to 0. 3) Other ? E. (PLC5 only) The examples have the BTW/BTR blocks in the STI file along with the PID. Is this really such a good idea ? =========================== MANUAL MODE CONTROL F. What is the difference between the manual bits SWM and MAN bits (PLC-5 only). When do you set one versus the other? G. What is the "best" way of programming "bumpless" Auto/Man transfer. (Bumpless, as I understand it, is no change in output when toggling between auto and manual modes.) Is this it: XIO PD30:0.SWM MOV PD30:0.OUT PD30:0.SO ================= TIEBACK H. What is the tieback used for? The help file refers to a manual control station (such as a single loop controller, which is physicaly wired to the valve?). If you don't have one, do you just enter a 0, or is/can it be used for other things (Do you feedback the actual position of, for instance, the control valve into the tieback (with the tank level as the PV)) ? I. How does it affect how the PID equation changes? (When transitioning SWM auto/man, the current position is the initial value of .SO.)? J. Is this a scaled value (engineering units) or raw (0-4095) ? K. How would / should tieback be programmed in a SLC to accomplish the same functionality ? =================================== SCALING L. (PLC-5 only) What is the difference between MAXS/MINS and MAXI/MINI ? I think that the MAXS scales the setpoint, while the MAXI/MINI scales the PV. M. Should the PV address entered in the PD block be raw (0-4095) or scaled (eng. units)? If it doesn't matter (and I've programmed it both ways), what values should the MAXI/MINI have (the desire, of course, is to monitor the PID block, online and with an HMI, in engineering units.) N. What is the scaling on the SP that is MOV'ed into the PD setpoint (raw, scaled, or "doesn't matter as long as its the same as the PV's")? If both SP and PV are in engineering units, should (must?) the MAXS and MAXI values be the same ? O. Since .SP is a 32-bit float in the PD file type, can Float be MOV'ed into .SP ? P. The SLC has only MAXS/MINS - is PV raw or eng units? Is SP the same scale as PV, or is only SP affected by MAXS scaling. Q. Obviously, it is good practice to do error checking on both the PV and SP, as in: BST LES HMI_SP_ENTRY PD30:0.MINS MOV PD30:0.MINS HMI_SP_ENTRY NXB GRT HMI_SP_ENTRY PD30:0.MAXS MOV PD30:0.MAXS HMI_SP_ENTRY BND BST LES AI_PV PD30:0.MINS MOV PD30:0.MINS AI_PV NXB GRT AI_PV PD30:0.MAXS MOV PD30:0.MAXS AI_PV BND Are there any other rungs that you typically have in your PID routines ? ======================= MISC. PID THEORY R. In setting up the PID, you can make it either Independant (aka AB, if using N: instead of PD
or Dependant (aka ISA). Which should you use in a particular application, how can you tell, and why do you use it ? S. Which type (Independent/Dependant) is SLC ? Can it be set up to do the other one? T. (PLC-5 only) You can set up 2 PIDs to be Cascaded loops (master /slave). When/why would you do this? How does this kind of loop respond differently from a single one? How do you go about tuning it? What should be the relationship between all the parameters (Kp, Ki, Kd, MaxS/MinS MaxI/MinI, update rate, etc) between the two PID blocks? How should the slave be programmed (enabled on .DN of Master block ? Vice versa ? Please include sample code.) U. If a loop is reacting too fast (overshooting, then undershooting, etc), what values should be tweeked: Update time (STI/TON.PRE); Ki,Kp,Kd (which way, larger or smaller)? V. What about too slow a response ? W. (PLC-5 only). You can have the derivative value based on PV or Error. How do you tell which is right for your application, and how does one type behave differently from the other?