# Calculation of PIDE in rslogix 5000

H

Hi fellows
i want to calculate the output of pide in excel but i need also to understand how i achieve this task and understand pide.

if any practical example link is available i appreciate.
also any web site where i understand the calculation formula's of pide in rslogix 5000.

thanking i will remain

M

#### marco

the PIDE-function is a very huge function without a lot of inputs, parameters and outputs. It can be used in a lot of different modes for different applications. As I first was reading the description of this function block (F1-Help in RSLogix5000) I was wondering why people always try to solve everything with just one function block???

So, although I think I can give you a brief description ot the main algorithm used in the PIDE, it really depends on the whole configuration of this funtion based on the input configuration parameters to predict how the PIDE exactly will react to certain input signals.

What you have to understand while trying to investigate the PIDE algorithm is that the outputs always depend on the input signals *AND* states, which represent results being calculated and stored in the last scan for the next scan. This means that a specific input signal to "PV" can lead to different output signals, depending on time and the trace of the input signal over time. So this means there's a lot of dynamic - plz be aware of that!!

Although I don't exactly remember the names of the input and output signals, the formula should *BASICALY* look like this:

CVnew=CVold+KP*(PVnew-PVold)+SAMPLE_T/KI*(PVnew+PVold)/2+FF_Previous-FF;

//Storing values/results for the next iteration:
CVold=CVnew;
PVold-PVnew;
FF_Previous=FF;

The CVnew value is calculated every time the PIDE function is executed and depends on the "old" values of CV (CVold), PV(PVold) and the FastForwardSignal FF(FF_Previous) and the new/current signals. CVnew will be output to "CV". SAMPLE_T represents sample/execution time in seconds depending on task configuration in RSLogix.

Aside of this basic algorithm there is some more functionality like output limiting (HLM, LLM) and Deadband on "PV" e.g. which is affecting "CV" as well. But please check also the "F1-Help" of RSLOgix for further details on these additional functionality. The RSLogix instruction help is quite good, although it does not contain the basic code.

I really have some doubts that you can actually simulate/emulate this iterative algorithm with excel - but good luck!

Best Regards,
Marco

P

#### pide

can u help me what is the output if these parameters used for one iteration.
we use only PI configuration.
KI=10 and KP=0.01 while sp is fix on 52.0 and the PV is 0 to 100.

if i suppose pv is 0n 45 then how i calculate the CV?
WHILE DERIVATE IS ON 0 SO IT NOT USED.

While other information is as under:
progprogreq = 1
sphilimit = 100
spllimit = 0

same for pv and cv high and low limit.
spprog is also used.

M

#### marco

Ok then, let's do this example:

You didn't tell us what your sample time is, so let's assume that your PIDE function will be executed every 100ms.

Further I don't know what you mean, when you write PV = "0n 45". Do you mean a constant value "0.45" or a step from "0" to "45"?? For the following explanations I will examine an input signal step from 0 to 45 between two scans, ok?

As a little difference to my last e-mail I will replace the values "PVnew" and "PVold" by "DEVnew" and "DEVold", so it gets clear that we use a constant for Setpoint (SP) and calculate the deviation (DEVnew) by subtracting SP-PV in every single iteration.

Let's have a look at the first iteration:

****************FIRST ITERATION*****************
//Inputs:
SP=52.0;//Fixed value
PV=0;
KI=10s;
KP=0.01;

//States:
DEVold=0.0;
CVold=0.0;

//Calculating the new values:
DEVnew=SP-PV=52.0-0.0=52.0;

CVnew=CVold+KP*(DEVnew-DEVold)+SAMPLE_T/KI*(DEVnew+DEVold)/2
-->CVnew=0.0+0.01(52.0-0.0)+100ms/10s*(52.0+0.0)/2=0.78

Storing new values for next iteration:
CVold=CVnew=0.78;
DEVold=DEVnew=52.0;

*************NEXT ITERATION*********************
//Inputs:
SP=52.0
PV=45.0//Step from 0 to 45.0
KI=10
KP=0.01

//States:
DEVold=52.0;//result of last scan
CVold=0.78;//result of last scan

//Calculating the new values:
DEVnew=SP-PV=52.0-45.0=7.0;

CVnew=CVold+KP*(DEVnew-DEVold)+SAMPLE_T/KI*(DEVnew+DEVold)/2
-->CVnew=0.78+0.01(7.0-52.0)+100ms/10*(7.0+52.0)/2=0.625

Storing new values for next iteration:
CVold=CVnew=0.625;
DEVold=DEVnew=7.0;

...and so on

...and so on...

Hope I didn't made any mistakes while typing these example values into my calculator.

Things get clearer now?

Bye for now,
marco