pid and floating point data in SLC5/02


Thread Starter


How can I configure PID in slc5/02(allen bradley)?
Wat is Timed mode and STI mode??
How can i get Floating data in SLC5/02
Floating point data is not supported by the 5/02. You'll have to upgrade to the 5/04 or 5/05, or a 5/03 OS301 or greater.

None of the SLC500 processors support a floating point PID, but that doesn't mean the PID can't be set up for some fairly sophisticated control schemes. Work with raw analog values, they are integers anyways.

Use STI mode if your program scan time is very long or your PID must execute very fast, say 200 times/second or more. If you use STI mode you must put the PID instruction in a STI program and configure your controller S file such that word S:31 has the STI program file number in it and word S:30 has the execution interval in 10mS units in it. In this way the processor will interrupt the main scan every S:30 x 10 mS and execute the PID and any other instructions in
the STI program. If you use an STI with a frequent execution rate, keep it short. If your scan time is fiarly short say less than <50mS which most programs are, and your PID update speed is from a few times a second to several
seconds, which most PID applications are, then use timed mode and put the PID instructuion in either the main program or a continously scanned subroutine.
Obtain the SLC Instruction Set Reference, A-B publication 1747-6.15, and read Chapter 10. It will explain the PID instruction fundamentals to you. The second paragraph of the chapter, for example, explains the difference between Timed and STI modes as follows:

"The PID instruction can be operated in the timed mode or the STI mode. In the timed mode, the instruction updates its output periodically at a
user-selectable rate. In the STI mode, the instruction should be placed in an STI interrupt subroutine. It then updates its output every time the STI subroutine is scanned. The STI time interval and the PID loop update rate must be the same in order for the equation to execute properly".

If you read ahead to Chapter 12, it includes the full description of timed interrupt routines in the SLC controllers.

The SLC-5/02 controller does not support floating-point math. In any case, the PID instruction in all SLC controllers uses integer values only.

The SLC instruction set reference is available from any Allen-Bradley dealer, and also online in PDF format from the "": download site, and the "": print-on-demand site.

Bob Peterson

RSLogix500 has a pretty good definition of all the parameters for the PID block available in help, instruction help, PID. There is also an instruction set reference manual you can download off the web site that has an very fine description of this instruction. I have never found a use for the STI version, as most loops I work with are rather slow and I tend to set the update (solve time interval) to anywhere from 1/2 sec on up.

Timed mode means the thing executes in a normal file that is called every scan, and you tell it in the PID block how often to solve the loop. STI mode means the PID block is in an STI file so it gets solved every time its called. This is also well defined in the help file.

There is no floating point available in an SLC5/02. Have to upgrade to an SLC5/03 for that. If you need more resolution then standard integer math you can get some limited 32 bit math in a 5/02. Check the help file for information on S:13 and S:14.

One irritating thing about the 5/02 is that the tuning parameters for the loops have less rangability (0.1 - 25.5) then is available in 5/03 and up CPUs which have a range of 0.01 to 327.67. I find quite often that loops in a 5/02 do not tune anywhere near as well because of this. E.G - you can set a gain of any value from 0.10 to 0.20 in steps of 0.01 in a 5/03 but you have to use either 0.1 or 0.2 in a 5/02. This can be a noticable difference in making the loop perform well, although most of the time its not a huge deal.


Integer PID is an output instruction for a rung. Read details of the setup in the Help files under RSLogix500.

Timed mode updates the data table at the loop update rate you request; STI mode updates every time the PID instruction is scanned and true (so you should use it in an STI ladder file). In the 5/02, I recommend you learn and apply the STI method unless your loop is very slow.

Floating point data is not available in the 5/02. If you need floating point, you can upgrade to a 5/03 (1747-L531) or move the entire system over to a less expensive MicroLogix1500 platform. Note that the PID is still integer-only in both the 5/03 and the ML1500, though.

If you only need floating point to scale your data, take a look at the SCL (Scale) instruction. I have used that instruction in the 5/02 to do calculations that were difficult using only integers. The 5/03 and ML1500 also have an even better instruction, SCP (Scale with Parameters).

Hope this helps!
Larry Lawver
Rexel/Central Florida