PLC 5 - Rate of Change

John Marysz

Member
Join Date
Jul 2009
Location
Indiana
Posts
5
I am looking for a way to calculate the rate of change. I need to alarm if the output of a PID loop exceeds a certain rate change (positive or minus)over a rolling time frame or even a fix time frame? Any help would be great!
 
Your question is very general so forgive me if my Answer is too. I use a similar technique in some proportional feedback loops to regulate pressure.

I select a "time constant" (mine is settable) and each occurrence of the "time constant" I determine the difference (by simple subtraction) between value of the process variable I want to monitor NOW, versus the same variable at the PREVIOUS "time constant".

At the NEXT occurrence at the time constant I do that again, and the DIFFERENCE is the "RATE of change" per "time constant".

You must take a snapshot of the variable 3 times to accomplish this.

Let's say your "setpoint" is 100psi, and you've selected a "time constant" of 1 second. In the FIRST snapshot the pressure is 100 so your "error" is zero. In the second snapshot the actual measured pressure is 98psi. Subtract 98 from 100 and your "error" is 2. Subtract 0 (previous error) from 2 (current error) and your "change in error" is 2. (at THIS point "rate of change" is still not known)

1 second later, your measured pressure is 95 giving you an "error" of 5.

Subtract 5 (current error) from 2 (previous error) and your "change in error" is 3 ( your error is greater by 3 THIS second than LAST second)

Subtract 2 from 3 and your "RATE of CHANGE" calculated for "error" is 1 psi per second. That is: your "error" is greater by 1psi THIS second than it was LAST second.

After each snapshot and calculation you would THEN MOV the current numbers into the registers for "previous snapshot" and the process would repeat.

Every second, you would determine Pressure, Error, Change in error, and finally, Rate of change in error.

Stationmaster
 
Stationmaster, you are taking the second differential of the input. This is like getting acceleration from a sequence of position readings. I think John Marysz is looking for the first differential, which is just this scan minus last scan. However, he may want to take several readings and average them or take two readings more than one scan apart.

Keith
 
Stationmaster, you are taking the second differential of the input. This is like getting acceleration from a sequence of position readings. I think John Marysz is looking for the first differential, which is just this scan minus last scan. However, he may want to take several readings and average them or take two readings more than one scan apart.

Keith


The first differential would be the AMOUNT of change. The second differential would be the RATE of change. I took him at his word that that is what he wants.

I agree that more data, over more time, and averaged out, may give a more valuable result in some cases, but he didn't really give many details on his application.... one could always shorten the sample interval and average.....

Stationmaster
 
What I'm doing is controlling pH by the addition of acid via am variable speed pump. The output to the pump is fairly stable +/- a few percent. On occation when the ph probe fouls(covered in oily waste), the controller ramps up adding acid to the stystem. What I'm looking for is something to monitor the output of the controller and alarm when that rate of change exceeds a certain amount.
 
The first differential is amount of change over a time period -- that is the definition of rate of change.

If you took an initial snapshot at time 0, then your second snapshot at time 1, the amount of change is the difference between the readings, the time period is time1 - time0. The differential is the ratio of those two numbers...
 

Similar Topics

We are using PLC 5 and currently have "Temp Rate Change Alarm" that is basically doing a compare every 8 seconds and alarming on any change of...
Replies
5
Views
2,546
Hello, I am using CPU226 I have downloaded Logic with 9.6Kbps Baud rate.It running ok.To increase Transmission speed I have to use baud...
Replies
1
Views
1,940
We have some thermocouples that we monitor and would like to set up the plc to monitor the rate of change for each of them and alarm if any of...
Replies
15
Views
12,393
Hi Group Hope everyone is ...not too shabby. I developed a program using RSLogix 500 for use on a MicroLogix 1400. I need to update to a newer...
Replies
15
Views
4,453
I have a unique situation where we have two separate process networks ( plc, HMI, etc only). The two process networks are are owned by two...
Replies
6
Views
2,150
Back
Top Bottom