Simple CLX PID question

russrmartin

Member
Join Date
Aug 2002
Location
Eastman, Wisconsin
Posts
744
Hi all. Simple question here. I've seen both sides of the spectrum here and no one can give me a concrete answer. On a AB CLX platform PID instruction, if the rung is false, does the PID integral term continue to change if the error is not equal to zero. I've seen two applications now where the integral gain is set to 0 when the loop is not active, and 1 where this was not done. All work fine, but I can't help but wonder now whether the integral term is incrementing while the loop is not enabled or not. Thanks.

Russ
 
It seems as though you are asking 2 different questions.

PID loop will not update anything if it's rung is false. This has nothing to do with what the Integral Gain setting is.

An Integral Gain setting of 0 will nullify the Integral portion of the calculation.
 
gmferg said:
It seems as though you are asking 2 different questions.

PID loop will not update anything if it's rung is false. This has nothing to do with what the Integral Gain setting is.

An Integral Gain setting of 0 will nullify the Integral portion of the calculation.

Not two questions, one misunderstood question. Perhaps the one question was not stated well. I have seen two examples here now where when the PID instruction rung is false, the Ki(GAIN)is manually set to zero. I would assume that this is done to clear out any value on the integral term of the equation. What I am wondering is whether or not the integral term continues to accumulate when the rung is false, assuming the Ki is > than 0. Or are people doing this only to ensure that upon the rung going true, the system response is the same as the Ki term is zero no matter what.

For instance, the loop rung goes false, loop stops updating all 3 terms. Program sets Ki to zero on the next rung. Value of integral term remains at whatever value it was when loop went false because the loop is not updated. Loop rung goes true, and integral term is set to zero due to one scan of Ki being zero. Next rung, Ki set to it's original value.

This is a matter of me seeing someone else' logic, and not understanding the why they did this part of it. Also wondering if it is standard practice, as I've never done it. I'm also wondering why if this is a standard thing, why AB doesn't give one the ability to just zero out the integral term of the equation.

Russ
 
Last edited:
I can see no reason for doing this and it would suggest to me that the person who wrote the code did not understand the operation of the CLX PID instruction. I assume that you are talking about a PID instruction which is executed in a periodic task because the PID rung will be false for most of the time if a clock pulse is used to trigger it. The instruction will update on every scan that the rung is true and will expect the rung to go true at exactly the interval set for the loop update time. There is no internal clock so if the update time is set at (say) 1S and the rung is turned off for 5min the instruction will assume that only 1S has passed when the rung is next turned on. I would always recommend leaving the PID instruction running continuously and using the SWM bit to turn the loop on and off and the SO value to set the output when the loop is off. I am sure there are other equally good methods but the case you describe just sounds wrong.
Andybr
 
I'd like to see this code 'cause it sure sounds wrong. As Andy stated, a CLX PID block should only be setup two ways:

In standard ladder with a timer.dn bit that pulses at the same frequency as the internal loop timer, or in a periodic task with nothing ahead of the block and the task time set to the same as the internal loop timer.

If what you describe is true, then they are resetting the KI every execution of the PID.
 
I think you guys may be confusing 'integral gain' and 'integral sum'. Setting Ki to 0 will not set the integral contribution to zero, at least in the vast majority of PID implementations. I know that all the books show the integral term as:
Ki * INTGL(e)dt, which infers that the integral sum is multiplied by the gain. In my experience, most PID loop integral terms act more like:
INTGL(Ki*e)dt.
Mathematically I believe they are equivalent. But in practice they are not. Setting Ki to 0 will simply cause the integral sum to hold at it's last level.

Having said that, I don't know why you would both set Ki to zero AND disable the rung. That doesn't make much sense to me.

However, I can think of cases where you would keep the rung enabled and set Ki to zero. I do alot of web applications. I can't always guarantee that the web is fully under control when I start. However, I want to have some correction to 'keep me in the ballpark' when I start. So I will operate with the integral effectively disabled and operate in proportional control only until i am confident I have full control of the system. This prevents excessive integral wind-up.

Keith
 
kamenges said:
I think you guys may be confusing 'integral gain' and 'integral sum'. Setting Ki to 0 will not set the integral contribution to zero, at least in the vast majority of PID implementations. I know that all the books show the integral term as:
Ki * INTGL(e)dt, which infers that the integral sum is multiplied by the gain. In my experience, most PID loop integral terms act more like:
INTGL(Ki*e)dt.
Mathematically I believe they are equivalent. But in practice they are not. Setting Ki to 0 will simply cause the integral sum to hold at it's last level.

Having said that, I don't know why you would both set Ki to zero AND disable the rung. That doesn't make much sense to me.

However, I can think of cases where you would keep the rung enabled and set Ki to zero. I do alot of web applications. I can't always guarantee that the web is fully under control when I start. However, I want to have some correction to 'keep me in the ballpark' when I start. So I will operate with the integral effectively disabled and operate in proportional control only until i am confident I have full control of the system. This prevents excessive integral wind-up.

Keith


Interesting approach on the KI web control. I too do a lot of web control with load cells and or dancers for tension trim. I'll typically limit the output of the PI integrator so that we are only trimming 1 to 2% of MaxSpeed. I'll have to look more closely at the PID drive blocks (siemens and AB) to see if this method can cause windup, even though I've never experienced a problem with it. On high speed web control, the gains and integrals are tuned so fast anyway, I'd think it be difficult to get into that situation.
 
Last edited:
Thanks for the info guys. It sounds like I'm not the only one who doesn't see the value in what they are doing. I've attached screenshots of the logic for clarification. The first pic is the PID block, and the second is the Ki manipulation below it.

FYI, this enable is not a pulse, and the PID sits in a continuous task.
 
russrmartin said:
Thanks for the info guys. It sounds like I'm not the only one who doesn't see the value in what they are doing. I've attached screenshots of the logic for clarification. The first pic is the PID block, and the second is the Ki manipulation below it.

FYI, this enable is not a pulse, and the PID sits in a continuous task.

I can't open it in word. But if it is in a continuous task, and the enable is not a pulse, then the PID block is not executing properly.
 
In a SLC500 whenever the rung containing a PID instruction is false the integral sum is reset automatically - hence you usually program the PID in the SLC500 on an unconditonal rung. The SLC500 PID self times, along with several other PITA nuances... but I regress.

However, in the PLC/5 and CLX PID this is not the case, the PID doesn't self time, its on a rung with a timer if in the continuous task, or, more preferably, on an unconditonal rung in a periodic task (or STI if PLC/5).

Now if someone were trying to make the PID work the same way as the SLC500 PID works then they would need to explicitly program the integral sum reset.

I don't see any reason to modify the Ki just because the rung is false.
 
From PID Help:

CLX_PID.JPG


From the above, you can see that the PID is really not implemented correctly. In a continuous task, it really needs a pulse, not a continous enable as you have.
 
What are you trying to set it to? Scoot the error window out of the way before the screen capture so the configuraton is visible.
 
novice said:
On a related question, why do I keep getting "Failed to set Loop Update Time" message even after setting value greater than zero?

You must be using Ver. 16. I just started tuning a loop last week in a ver 16 program and I kept getting the same error. Anytime I would bring the loop up to change parameters or even just to view parameters, when I would close it this error would pop up. The value I had in there was 1 second. I would re-enter 1 second and it would still give me the error.

Must be a bug in this new version.
 

Similar Topics

Hello again..trying something on an existing poorly written program and just wanted to double check something system is an A-B MicroLogix 1200 In...
Replies
5
Views
170
Hi all, Writng a FB in ST on Beckhoff TC for a pulser which turns on and off on a cycle, is paused by turning bControlInput to FALSE, but resumes...
Replies
6
Views
258
I'm trying to build my Classic Step 7 programming skills this weekend. I get stuck on little things that are not covered in YouTube tutorials. I'm...
Replies
7
Views
319
I have a program that does a 7 second "scan" sensor calibration routine whenever a setting (setting is called assistance level or "AL" and ranges...
Replies
3
Views
214
Hi all, I have a simple question that I have overcomplicated and gotten stuck on. I have a variable, we can call it "light" that I need to stay...
Replies
4
Views
321
Back
Top Bottom