PID loop update in ML1100

ASF

Lifetime Supporting Member
Join Date
Jun 2012
Location
Australia
Posts
3,921
Hi all,

I've been tasked with migrating a standalone control box with a Micrologix 1100 into an existing 5380 Compact Logix controller. It has a PID loop in it, and I've never set up a PID control from scratch in Logix 500, so I'd just like a sanity check.

The PID setup screen has the loop update time set to 0.30 (seconds) and the time mode set to STI. If I understand correctly, this uses the PLC's internal clock to automatically execute this PID instruction on a timed basis.

The help page for the PID setup screen tells me:
When in the STI mode, this value [loop update time] must equal the STI time interval value S:30.
I can't see anywhere that S:30 is set, and when I look at the data table it appears to be zero. That being the case, would I be correct in suggesting that this PID loop is incorrectly configured and is at the mercy of the PLC scan time for its consistency? And that, therefore, the existing tuning values will be useless because I'll now have to re-tune it with a loop update time that's actually fixed (and different)?
 
Hi all,

I've been tasked with migrating a standalone control box with a Micrologix 1100 into an existing 5380 Compact Logix controller. It has a PID loop in it, and I've never set up a PID control from scratch in Logix 500, so I'd just like a sanity check.

The PID setup screen has the loop update time set to 0.30 (seconds) and the time mode set to STI. If I understand correctly, this uses the PLC's internal clock to automatically execute this PID instruction on a timed basis.

The help page for the PID setup screen tells me:
I can't see anywhere that S:30 is set, and when I look at the data table it appears to be zero. That being the case, would I be correct in suggesting that this PID loop is incorrectly configured and is at the mercy of the PLC scan time for its consistency? And that, therefore, the existing tuning values will be useless because I'll now have to re-tune it with a loop update time that's actually fixed (and different)?

In STI mode, the PID instruction should be placed in a routine that is designated as the STI routine. That would mean that there is not a JSR calling this routine, rather it is enabled by the STI configuration.

The Help file for RSLogix 500 is pretty thorough, but keep in mind that it covers a variety of platforms including the SLC and Micrologix with all the variations in each family.

For the ML1100, the set up for the STI routine is done with Function Files that may or may not coincide with the older SLC S:x data table address locations.

I just did a quick test and when I used the Function file to set up a routine for STI and put 30 milliseconds in the setpoint, the status word S:30 does indeed change to 30. That leads me to believe that you are correct in saying that the logic you have inherited is indeed set up incorrectly.

If I had a nickel for every PID I came across that was incorrectly configured...I'd be closing in on a dollar about now...

The last one I did migrate to Logix5k from a PLC-5 had many loops and one of them was configured properly. The others, I intended to modify but due to time constraints and the fact that these were critical loops that I could not afford to foul up, I chickened out and just put them in a periodic task set for the same update rate as the average scan time of the PLC-5. That allowed me to get almost identical performance as the PLC-5 (which had worked okay for 20 years) without editing the gains.

I have never done a migration from a Micrologix to Logix5000, but from a PLC-5, the project migrator utility did a pretty good job of creating and properly setting up all the parameters for the PID.
 
Last edited:
besides the "timing/triggering" issue ...

everything that you and Okie have posted so far looks good (as near as I can tell without seeing the code) ...

but here's a potential "gotcha" that might pop up ...

the RS5000 software allows you to select between TWO flavors of "PID Equation" ... the Dependent ... and the Independent - with the Independent being the default ...

on the other hand - the MicroLogix 1100 only supports the Dependent ...

so - if you're not careful, you might end up trying to plug in Dependent settings - into an Independent equation ... in that case, the TIMED components (Integral and Derivative) will be completely skewed ...

so if the control resulting from your best guess goes nuts - you might try changing the setting for the PID Equation to the Dependent option ...

DISCLAIMER: I'm not sure how the "conversion" feature will handle changing from a ML1100 to the Logix platform ... MAYBE it will automatically change the PID Equation setting for you ... but I'd double check it ...

good luck with it ...
 
Last edited:
In addition to the pitfalls mentioned above (Loop Update and PID Equation form), you will also want to make sure the input and output scaling are consistent. Otherwise there may be tuning-related issues in the migrated system.

The ML is based on 0 - 16383 (PV) input to 0 - 16383 (CV) output, meaning there is an implicit percent-to-percent, or "dimensionless," proportional gain (KC) term. If the PV reference is an analog input configured as "Scaled for PID" or otherwise set up for a 0 - 16383 count range, your instrument range becomes the input percent basis. Similarly for the analog output, 0 - 16383 counts is intended to directly drive the final control element over its 0 to 100% range.

On the Logix 5000 side, there are additional settings to ensure the percent in/out relation carries through. Specifically, the unscaled input range (MINI/MAXI) -- which is fixed at 0 to 16383 in ML -- must be explicitly specified, and will be based on the analog input channel range. The output side has a similar pair of configuration values (MINCV/MAXCV) to convert the PID 0 - 100% into appropriate analog output counts.

Assuming the ML input and output had PID scaling (i.e., 0 - 16383), and there are no instrumentation changes with the migration: you will want to verify the PV source (i.e., input module) is set up for 0 to 16383 full-scale counts, and MINI = 0, MAXI = 16383. Also on the output side, MINCV = 0 and MAXCV = 16383 corresponding to full scale in the analog output configuration. (The particular 16383 value is arbitrary, so long as the I/O module scaling is consistent with PID min and max values).

If these input-to-output relations are kept consistent, the PID gains, as displayed in the ML configuration dialog, should directly translate to the dependent-equation tuning values in L5K. (If viewing the ML gains in the data file, you must take the RG bit into account.)
 
Thanks Okie and Ron.


I've also never set up an STI routine in Logix 500 before, so wasn't sure where to go looking. As it turns out the PID instruction isn't in an STI routine at all, it's in the main routine. I'm assuming that to set up a routine as the STI routine you would set the PFN (program file number) to the LAD number of the routine you want to execute on a timed basis, correct? That value, along with the SPM (setpoint between interrupts) are both zero, so I'd say I'm probably pretty safe in saying that this PID is incorrectly set up.


Thanks for the tip too regarding dependent/independent gains Ron - that's not something I was aware of and it would probably have taken me a while to work out.

My next question is, if I get online with the processor and find that the scan time is e.g. 10ms as opposed to the 30ms time that's configured in the instruction, is there some rule of thumb or guesstimate I could use to adjust my gains accordingly? I don't imagine it's as simple as just dividing all my gains by 3, but I really have no idea. The program is not especially complex, and I imagine that the scan time would be fairly consistent.
 
Thanks Mispeld. The ML1100 PID is all set up with the inputs and outputs scaled 0-16383 so no issues there.

I'm not just using the conversion utility; I'm re-writing completely, as the code is, well, not great. And a good chunk of it is redundant because a lot of the code is going into interfacing with the main system that it will now actually be a part of. I'm reasonably familiar with PID on the Logix 5000 platform so should have no trouble replicating the functionality - it'll just be tuning it that might cause me some fun. I think that the 5380 Compact Logix scan time might be a touch faster than the Micrologix :D
 
My next question is, if I get online with the processor and find that the scan time is e.g. 10ms as opposed to the 30ms time that's configured in the instruction, is there some rule of thumb or guesstimate I could use to adjust my gains accordingly? I don't imagine it's as simple as just dividing all my gains by 3, but I really have no idea. The program is not especially complex, and I imagine that the scan time would be fairly consistent.

IIRC, proportional gain would not change, integration time constant would decrease by a factor of roughly three (which may mean whatever constant is there should increase by a factor of three), and derivative should be the opposite of integration. There are some second-order effects in there, and PV noise may be more or less of an issue with the shorter scan time, so I would expect to have to hand-tune after the transition.

But I've been out of the control game for a long time, so that could be completely bogus advice :confused:

Right now I am trying to figure out what to put in [PID file] for my demo PID loop - I have a 23-element INTEGER file N14, and the help file seems to say that N14:0 is what belongs in there, but verify keeps throwing an error.:unsure:

[RSL Micro Starter Light/RSLinx Classic/RSL Emulate500]
 
Right now I am trying to figure out what to put in [PID file] for my demo PID loop - I have a 23-element INTEGER file N14, and the help file seems to say that N14:0 is what belongs in there, but verify keeps throwing an error.:unsure:

[RSL Micro Starter Light/RSLinx Classic/RSL Emulate500]


FYI, RSL Emulate 500 does not support the PID instruction.

See pdf
 
Last edited:
IIRC, proportional gain would not change, integration time constant would decrease by a factor of roughly three (which may mean whatever constant is there should increase by a factor of three), and derivative should be the opposite of integration. There are some second-order effects in there, and PV noise may be more or less of an issue with the shorter scan time, so I would expect to have to hand-tune after the transition.

But I've been out of the control game for a long time, so that could be completely bogus advice :confused:
I ended up splitting that question into a separate thread for clarity, ran some tests, and found more or less just that.


http://www.plctalk.net/qanda/showthread.php?t=122967&page=2
 

Similar Topics

Hi all, splitting out from this thread because it's a somewhat different question to the original. I have to migrate some code from a Micrologix...
Replies
17
Views
4,069
Today I upgraded an L55 processor with an L82, which ended up being the 2nd unsuccessful attempt but thats a different story. After starting the...
Replies
15
Views
4,476
Just tuned a heating application where my natural period was 250 seconds. Everything I've read says that the loop update time should be 5-10 times...
Replies
1
Views
1,627
May be my question is too childish, but can i get all the answers please? For PID of ML1400, if I right loop update as 0.02 & time mode as STI...
Replies
4
Views
4,756
Hi All, I want to know There is some relationship between SLC500 or PLC5, Controllogix watchdog time and PID loop update time. Does it need to set...
Replies
2
Views
5,256
Back
Top Bottom