allen bradley PIDE proportional vs derivative

rollex

Member
Join Date
Mar 2014
Location
Australia
Posts
55
This might seem like a dumb question however I can't see the difference and can't test it as I don't have an allen bradley PLC available.

In the PIDE block the function is CV = CV-1 + Kp* Delta E + ...

How is the action of the proportional gain any different to the derivative in this case? Eg Kp * Delta E vs Kd * (E -2En-2 + En-1)

Eg the following values:

SP: 50
PV: 50
CV : 0

KP = 1
KI = 0
KD = 0

Change PV to 75 with a Kp of 1 and scan time of 1 second

Delta E is 25 hence CV = 0 + 1*25 so CV = 25

OR
SP: 50
PV: 50
CV : 0

KP = 0
KI = 0
KD = 1

Change PV to to 75

CV = 0 + 0*25 + 1*(25 - 0 + 0 )/ 1 so CV = 25

if you use the traditional equation of CV = KP * E then the proportional gain operates quite differently to the derivative, however if you use change in PV as your proportional gain entry in a PIDE block I'm curious how this acts any differently to derivative gain?

Can someone explain where I am going wrong? The reason I ask this question is I have the following example in the field where the PIDE simply does not work.

SP: 10000
PV: 1000
CV : 0

in 1 second PV jumps from 1000-3000, so a delta E of 2000, even with a tiny Kp this results in movement of the CV despite the PV being absolutely no where near the SP. I would expect this behaviour from Kd however there seems no way to avoid it when using a PIDE block.

The solution is to use a PI block instead however it raised the question of how is Kp different from Kd in a PIDE block?
 
Run through your equation for three seconds and you will see different results.

At time t0, SP=PV, CV=0
In your example, you change SP by 25 with Kp of 1 and Kd of 1. We will assume that for some time greater than 3 seconds the PV doesn't change in response to the CV. Given these stipulations at 1 second:

DeltaE = 25
Proportional correction = 25
Derivative correction = 25
CV = 50

At 2 seconds:

DeltaE = 0
Proportional correction = 0
Derivative correction = 25
CV = 75

At 3 seconds:

DeltaE = 0
Proportional correction = 0
Derivative correction = -50
CV = 25

At 4 seconds and after:

DeltaE = 0
Proportional correction = 0
Derivative correction = 0
CV = 25

So as you can see the derivative action and the proportional action do provide different responses and the CV will settle at Kp * Error for any steady state error.

Keith
 
Sorry I get that they are different, however the p seems to act like derivative initially. Eg in the scenario where my pv is no where near my sp a large rate of change in the pv will cause the cv to kick.

In the real world this is a gas flare that absolutely must not open unless the pv is near the sp this makes the pide unusable.

Can you think of a work around? Traditional pid does not have this behaviour.
 
Originally posted by rollex:

...however the p seems to act like derivative initially.

I disagree. It acts as a proportional term would, producing a response proportional to the instantaneous error.

The form you show is the incremental form of the PID equation. People tend to think more of the absolute form of the PID equation. The absolute form multiplies the instantaneous error directly by the proportional gain. Given your case above, both implementations will produce a stepped proportional response of 25 at 1 second and will maintain that output of 25 as long as the instantaneous error is 25. As the error decreases both implementations will decrease the output.

My initial thought is you are asking the system to do something it cannot physically do. Most users do. There is no way that any system can follow an instantaneous change in the setpoint.

So you have a few choices. The first is don't allow the setpoint to make a step change. Ramp any change in setpoint into the controller at a rate that the system can respond to. this will keep the SP into the controller closer to the PV at all times. Another option is to filter or ramp the output of the controller if it is just the step in control output that causes the issue. This is much less desirable because you are putting a delay in the control path. A final option may be to use the I-PD form of the PID equation if that is an option.

Keith

Edit: there are boolean selectors in the PIDE that MAY allow the control function to operate as an I-PD but I'm not sure. They are selectors that will determine is the P and D elements operate off of error or feedback. that may do what you want.
 
Last edited:
The example I gave was a step change in pv, the sp was unchanged.

Eg if I use E = pv - sp the proportional term should be zero until the pv is above the sp.
Using cv = kp*E (traditional pid)

Pv 0
Sp 100
Kp 1
Cv =-100*1 =0

Pv 50
Sp 100
Kp 1
Cv =-50*1 =0

Then
Pv 150
Sp 100
Cv = 50*1=50

The above is what i want however if I use pide I get the following result


Pv 0
Sp 100
Kp 1
Cv = 0 + 0*0=0

Pv 50
Sp 100
Kp 1
Cv =0+(-50- - 100)*1=50

Eg the cv has opened due to a large pv change despite the error being negative.

The cv then returns to zero shortly afterwards however it cannot open at all until the pv is very near or above the sp so I cannot use it to control a gas flare
 
Last edited:
kamenges you were most helpful, are you able to explain where I have been going wrong?

At first glance my calc seems to imply I have gotten my error term around the wrong way however in practice the system controls and works with the gains I have given it yet it gives the CV kicks when miles away from the SP, this is what I want to solve.

I have tried setting Kp to 0 and the kicks go away.
 
in practice the system controls and works with the gains I have given it yet it gives the CV kicks when miles away from the SP,

can you post a trend/graph of these "kicks" for us? ... if so PLEASE change the colors and scale so that we can actually SEE what you've posted ...

the best way to show this would be to graph the PV, the CV, and the SP ...

how high do the kicks go? ... how often do they happen? ...

maybe I'm misunderstanding ... let me ask this: how did the PV get "miles away from the SP" in the first place? ...

is there just ONE "kick" when you first put this thing into operation (at startup) - or does the PV suddenly change during operation - or maybe the SP just got changed? ...

taken from one perspective - any one of those conditions would be expected to give the CV a "kick" - if the tuning included a healthy dose of Proportional action ...
 
Last edited:
I know what is happening.

Heed Keith's suggestion about investigating I-PD.

Ron, the "kick" is caused by step changes in the SP.

Many years ago I created some spread sheets that simulate different types of systems that are controlled by PIDs so one can change the system parameters and the PID parameters and learn from the results. I posted links to them here and had a contests to see who could tune each spread sheet the best.
 
from Peter:

Ron, the "kick" is caused by step changes in the SP.

well, I suspected as much - my biggest question is why does the OP seem surprised by seeing that effect? ...

DISCLAIMER: I haven't been following this thread too closely - so please feel free to ignore me ...
 
The kicks have nothing to do with changing the setpoint, the setpoint is never changed in this scenario as it is a field to flare on a gas facility.

Eg the plant operates at ~5-7000 kPag, it cannot operate above this so if the line pressure raises too high they vent the gas to a large flare. This means the PV almost never is near the SP and the CV is almost always 0%

if a plant upset occurs and they cannot take the gas, this means the inlet pressure rises and the flare opens and it will start controlling at setpoint, this is rare however and the flare cannot open unless this scenario has occured as they waste gas for no reason.

can you post a trend/graph of these "kicks" for us? ... if so PLEASE change the colors and scale so that we can actually SEE what you've posted ...

the best way to show this would be to graph the PV, the CV, and the SP ...

how high do the kicks go? ... how often do they happen? ...

maybe I'm misunderstanding ... let me ask this: how did the PV get "miles away from the SP" in the first place? ...

is there just ONE "kick" when you first put this thing into operation (at startup) - or does the PV suddenly change during operation - or maybe the SP just got changed? ...

taken from one perspective - any one of those conditions would be expected to give the CV a "kick" - if the tuning included a healthy dose of Proportional action ...

Heed Keith's suggestion about investigating I-PD.

Ron, the "kick" is caused by step changes in the SP.

Many years ago I created some spread sheets that simulate different types of systems that are controlled by PIDs so one can change the system parameters and the PID parameters and learn from the results. I posted links to them here and had a contests to see who could tune each spread sheet the best.

T4nhgIz.png


can you post a trend/graph of these "kicks" for us? ... if so PLEASE change the colors and scale so that we can actually SEE what you've posted ...

the best way to show this would be to graph the PV, the CV, and the SP ...

how high do the kicks go? ... how often do they happen? ...

maybe I'm misunderstanding ... let me ask this: how did the PV get "miles away from the SP" in the first place? ...

is there just ONE "kick" when you first put this thing into operation (at startup) - or does the PV suddenly change during operation - or maybe the SP just got changed? ...

taken from one perspective - any one of those conditions would be expected to give the CV a "kick" - if the tuning included a healthy dose of Proportional action ...

Heed Keith's suggestion about investigating I-PD.

Ron, the "kick" is caused by step changes in the SP.

Many years ago I created some spread sheets that simulate different types of systems that are controlled by PIDs so one can change the system parameters and the PID parameters and learn from the results. I posted links to them here and had a contests to see who could tune each spread sheet the best.

As above the kick is not due to the SP being changed. It appears the small large ramps in the PV are causing the CV to start opening. The CV on goes to 1-2% however this causes a massive flame to come out the stack and everyone to freak out.

I have solved the problem by setting my proportional gain to an extremely low number and making the loop almost entirely integral. After looking at the PID vs PIDE equation I believe I can see why the PIDE kicks the CV when it has a negative error however I'm not sure how to resolve it properly.
 
Last edited:
You have a requirement for only opening the valve when ER > 0

Solution 1: Integral only control:
Integral is the only term that will not increase the OP unless ER > 0. I am not sure if this will give you smooth enough control of your output, but this might not be important in an over pressure situation.

Solution 2: Downstream logic:
The pseudocode for only allowing your valve to open if ER > 0 is:
IF ER < 0 Then
SELECT.OP = MIN(PIDE.OP,SELECT.OP)
Else
SELECT.OP = PIDE.OP
End If

Solution 3: Roll your own PID
for just the P term as you described, you can use a scale block or similar.
 
You have a requirement for only opening the valve when ER > 0

Solution 1: Integral only control:
Integral is the only term that will not increase the OP unless ER > 0. I am not sure if this will give you smooth enough control of your output, but this might not be important in an over pressure situation.

Solution 2: Downstream logic:
The pseudocode for only allowing your valve to open if ER > 0 is:
IF ER < 0 Then
SELECT.OP = MIN(PIDE.OP,SELECT.OP)
Else
SELECT.OP = PIDE.OP
End If

Solution 3: Roll your own PID
for just the P term as you described, you can use a scale block or similar.

I thought about using traditional PID so the CV wont open unless E > 0 however time (funding) was limited it was simpler to use very low Kp, the tuning is not great however as it simply needs to just keep the pressure below the SP within 10% it does the job.

Your solution would run into issues where to control at SP the valve may need to be ~20% open, this would result in the CV hammering between 0 and 20% very quickly when the PV is sitting right on the SP, this would probably result in some pretty nasty carry on effects to the pipeline, I could implement a ramp but by the time I've done that I might as well just roll my own custom PID loop that does some funky ramping or something.

The thing that annoys me is this sort of control is not uncommon and traditional PID in other controllers handles it fine.
 
You need to use the integrator term when using the incremental form of PID. Why not do as Keith suggested and use I-PD? The problem is that your PIDE multiplies the proportional gain by the change in error. An I-PD would multiply the proportional gain by the change in the PV only. Changing the PV manually would still cause a jump in the output but the SP can change in steps without seeing big steps in the output.


I don't see why the output is spiking like it does. There is no change in the SP more is there much of a change in the PV or you are writing to some of the internal variables. It shouldn't do that unless there is noise of some sort.
Trying using the integrator on the error and proportional gain only on changes in the PV.
That is the I-P control.
 

Similar Topics

I've read 1756-rm006 and I can't fully understand what the difference is between manual and operator control mode. I'm used to "auto" and...
Replies
11
Views
4,115
Hallo Everybody, Did anybody from you had a sample how to do pump control with flow sensor ??? I only did temperature control with pide yet...
Replies
4
Views
4,575
Hi Guys! I'm having problems getting the AB PIDE block to actually regulate anything, it seems to be the same problem everytime I try to use one...
Replies
23
Views
6,887
Hi, I have a ControlLogix system with 1756-IF16 analogue inputs. I can't scale the inputs at the card as there is a requirement to facilitate...
Replies
12
Views
261
Dear community, I am trying to find a tool for Allen-Bradley PLCs similar to SiVArch for Siemens PLCs to automatically generate faceplates and...
Replies
0
Views
81
Back
Top Bottom