PLC-5 Rate of Change Question

tsalheiser

Member
Join Date
Oct 2008
Location
AL
Posts
10
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 them reach a certain rate of change setpoint. my knowledge of the plc 5 is pretty good but I'm unsure how to tackle this one in the easiest way. any help is much appreciated.

- Tim
 
Identify a period over which you want to monitor the rate of change. Lets say one minute. Create a sixty second timer. At the beginning of the time period store the current temperature in a register somewhere. At the end of the sixty second time period subtract the value stored at the beginning from the current temperature. The difference in temperature is the rate of change in degrees per minute. Divide by 60 to get degrees per second. Now reset the timer and use a MOV instruction to store the current temperature in the same register you used previously.

If you use a different time period then adjust accordingly. For example, if you use a ten second period then divide by 10 for degrees per second or multiply by 6 for degrees per minute.

A052109A.JPG
 
Last edited:
Thank you for the reply Alaric. That was the line i was going down at first, but i wanted to make sure there wasn't an easier way since there are ~100 of these i need to do. Guess i better get at it. Thank you again,

- Tim
 
If you have 100 of them, it might be a tiny bit faster to use a parameterized subroutine. It's been a while, but I think you can pass timers through as input parameters.

Then, if you set up your data tables nicely, you could actually loop through them with indirect addressing to do alarm detection for elements 0-99.
 
I don't see how subroutines with parameters make anything "faster". That parameter passing is overhead, it takes longer to execute. It may indeed have benefits, but speed isn't one of them.

How about this? I think it follows Alaric's description pretty well. It also incorprates the "set up your data tables nicely" idea rdrast mentioned.

XIO T4:0/DN TON T4:0 0.01 100 0
XIC T4:0/DN BST FAL R6:0 100 0 ALL #N7:200 #N7:0 - #N7:100 NXB COP #N7:0 #N7:100 100 BND

N7:0 - 99 = current values
N7:100 - 199 = last values
N7:200 - 299 = ROC values in units/sec

Modify the expression if you want to evaluate at a different rate. i.e. Every 10 secs, (#N7:0 - #N7:100) * 10

If you divide, you might have to make the destination a float to make the information useful.

Also, if your ROC is expected to be small, you may be forced to measure over a longer time span to get a useable number. It is possible to measure over 10 seconds for instance, and still update every second, it just takes a bit more math.

BTW, the thing I like about the FAL instruction over most alternates, NO JMP to LBL.
 
Last edited:
The real problem....

is to find the derivative of a sequence of points. Jack Crenshaw has information on how to do this. I am away right now but I have routines from reading Jack Crenshaw's book on how to find the nth derivative from a sequence of points.
http://www.amazon.co.uk/Math-Toolkit-Real-Time-Programming-Crenshaw/dp/digital-features/1929629095
Jack Crenshaw write articles for embedded systems magazine.
http://www.embedded.com/columns/programmerstoolbox/175002472

Averaging of one minute will not work if the rate of change is always changing. What is necessary is to fit a curve to the last N points and then be able to take the derivative at the last point.
 
Averaging of one minute will not work if the rate of change is always changing.

Peter is correct. The assumption I made is that the OP's temperature process is a typical temperature control process where the temperature and derivitive of temperature changes relatively slowly. In that kind of process I think that measuring change over an appropriately chosen time period may be sufficient. (I chose 1 minute for the example, which might be completely wrong for the OP's process) You must properly evaluate the method I showed as to whether it will yeild satisfactory results. It might be fine for a huge industrial furnace but completely off base for an paint curing tunnel with a variable load. If it won't work then the method is only worth what I charged for it($0) so then compute the derivitiave of a sequence of points.
 
Been thinking on it rate of temp change is dTEMP/dt. Uhhh that is a derivitive is it not? And it would be a measurement of the slope of the temperature over some time base? Now all that it seems to me that is being discussed is what is the most appropriate time base ie per degree change is the time measured in seconds minutes or hours?

Dan Bentler
 
We have a player, this topic is has come up too many times to let is slide.

Been thinking on it rate of temp change is dTEMP/dt. Uhhh that is a derivitive is it not?
Yes

And it would be a measurement of the slope of the temperature over some time base?
Only if the Δt is infinitely small.

Now all that it seems to me that is being discussed is what is the most appropriate time base ie per degree change is the time measured in seconds minutes or hours?
Dan Bentler
A temperature system has time constants in minutes so the sample time should be 10 times shorter than that. What is the maximum error when sampling 10 times faster than the plant time constant? In short. What is the slope at time 0 to time 0.1*tau? How does that compare to the derivative at time 0.1*tau? Is the error acceptable? What it the time was 0.2*tau?

tsalheiser didn't give us any information about his plant so we can't give him an answer.
 
Thank you everyone for your responses. I work in a steel mill and the thermocouples are monitoring the bottom temperature of the anode shell. There are ~40 per shell in a circular pattern across the bottom. The temperatures are generally the same and rise relatively slowly depending on how much we are running on that shell. Temperature start out around 200-300F and in about a 3 months will rise to ~700F. We burned through part of the bottom of our shell due to arcing in one particular spot too long. It happened pretty fast and we weren't able to catch it before the temperature in the one spot hit one of our high limits. We would like to imply a rate of change for each one. If we would have had this it would have caught the rise in temperature fast enough before we sent steel out the bottom of our shell. If you need any more information please let me know.

- Tim
 
Wow!!! That shed some light on the problem, but stop being vague

I thought you needed the rate of change for a control loop or something. You don't need anything very accurate but I do have a question now.

How fast did the high temperature problem occur? What is pretty fast? Seconds, minutes?
Do you ramp up your furnace SP temperature slowly and always know what it should be?
What if the ErrorRate is converging on the SP. Is that a problem?

I would simply do this:
Error(n)=SP(n)-PV(n)
What you don't want is for the error to be very negative. Lets say you can't let the Error go below -50 degrees with out an alarm.

Next you need to look at the error rate. The error rate shouldn't be a problem IF the PV is much less than the SP. So if the Error is getting more negative then the ErrorRate is negative. Positive Error rates shouldn't be a problem. Are they?

dError(n)/dt or ErrorRate(n)=(Error(n)-Error(n-1))/Δt
The basic error rate calculation is that simple and probably doesn't need to be that accurate if you are looking for gross temperature changes. Δt should be on the order of a few seconds if you need to error events that happen in a minute. It should be much shorter than the time it takes to burn a hole in your furnace. This formula will provide an error rate but it doesn't take into account the current temperature. When near a limit it is best if the error rate is kept small or converging.

A quick trick.
Code:
if Error(n)*ErrorRate(n)<0 then
    converging Error   // good 
else
    diverging Error    // bad
endif

Combine the Error and Error rate calculation
Code:
s=τ*ErrorRate(n)+Error(n)   // τ is a time constant
If s < -50  degrees then
    Alarm
endif
Note s= (1+τ)*Error(n)-τ*Error(n-1)

This formula uses the ErrorRate to predict what the temperature will be some time in the future assuming a time constant τ. Notice that the units work out. ErrorRate*τ has resulting units of Error. The two terms, the Error and ErrorRate terms are summed together to predict a future error. You can then compare this with your ErrorLimit of -50. If the error is more negative than -50 or the predicted error is anticipated to go below -50 or the sum of the two is less than -50 then sound the alarm.

τ is different from Δt. Δt is the sample time and τ is the time constant that adjusts the sensitivity of the error rate detection. As τ get bigger it is assuming that the thermal mass is larger and if the rate of change better be smaller to keep the alarm from sounding.

You haven't made if clear if the goal is to measure error rates or just detect when the error rate is going to be a problem. I normally don't think of converging error rates as being a problem but it could be in your case if there are limits to how fast the furnace can be heated up or cooled down.

I hope you can see what I am getting at. A converging Error rate is usually not a problem. A diverging error rate gets more severe as the Error itself gets larger.
 
Last edited:
Thank you everyone for your responses. I work in a steel mill and the thermocouples are monitoring the bottom temperature of the anode shell. There are ~40 per shell in a circular pattern across the bottom. The temperatures are generally the same and rise relatively slowly depending on how much we are running on that shell. Temperature start out around 200-300F and in about a 3 months will rise to ~700F. We burned through part of the bottom of our shell due to arcing in one particular spot too long. It happened pretty fast and we weren't able to catch it before the temperature in the one spot hit one of our high limits. We would like to imply a rate of change for each one. If we would have had this it would have caught the rise in temperature fast enough before we sent steel out the bottom of our shell. If you need any more information please let me know.
- Tim

SO what the problem boils down to is that in this the fire brick wears (burns??) away and you get hot spots which can burn out the unit.

Is this a 3 phase carbon arc furnace?? Worked around 125 ton 3 phase 480V 56,000 A unit in Seattle.

Burn thru could get right exciting I bet.

With 42 (was it??) monitor points I would think a data logger with alarming capabiltiy for each channel would be good choice. I would check with Fluke. You may be able to get dT/dt capability.

Dan Bentler
 
The furnace is a DC arc furnace. ~750V, 120Kamps(full power). The burn thru happened over a period of a couple minutes. They were wanting something to the effect of an alarm triggering at ~+50F change over a minute.
 
Then look at my example

The furnace is a DC arc furnace. ~750V, 120Kamps(full power). The burn thru happened over a period of a couple minutes. They were wanting something to the effect of an alarm triggering at ~+50F change over a minute.

Make the time constant about 1/5 the time of the time it took to burn through. Round the time up or estimate high if in doubt. If the burn through took 5 minutes then the minimum time constant would be 1 minute.

If there is no error but the rate of change is -10 degrees a minute then the alarm will trigger. If the error is already -10 then and error rate of -8 degrees per minute will set off the alarm.

It would be to round up the time constant to get the alarm to trigger at a lower rate.

8 or 10 degrees a minute would be very fast in your case.
 

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,561
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,951
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...
Replies
6
Views
3,560
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,470
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,174
Back
Top Bottom