Temperature profile

Alan Case

Lifetime Supporting Member
Join Date
Apr 2002
Location
Wagga Wagga
Posts
1,268
Hi.
PLC = Contrologix
I am trying to think of the best way to start a project where I need to vary the temperature of a product for tempering purposes.
A temperature profile may be start at 500 degrees C then drop 5 degrees over 2 minutes, then rise 1 degree over 1 minute then repeat until 40 degrees is reached. At present the rise and fall temps and times are to be all the same but I can almost guarantee that at some stage they will want to vary these.
As can be seen from my hand sketch (very rough) there is a base temperature profile (dotted) over which the fall and rise profile (solid line) will reside. The profile I wish to follow is the solid line.
I can generate a saw toothprofile using the function generator FB. The maths to populate the FB arrays is grade school level so I have no problem with that method.
The output of the function generator could be fed into a PIDE which could give a S-Curve/Sinewave type transition from rising to falling temp and vise versa. To me this is not the most elegant way to do this. (copy of RSLogix trend of this method attached)

Another method is to use the RMPS FB with where the soak time is minimal and soak temperatures are incrementing and decrementing.

Peter had a suggestion of cam tables using time instead of position but I cannot see any way to access the data in a cam profile.

Peter also suggested lagrange interpolation to get a formula I could use. This does not look overly hard so it could be the way to go.

I welcome any and all advise

Regards Alan

Edit. Remove .pdf from the jpeg file
 
Last edited:
Simple Interpolation Methods

Actually you may need a combination of techniques depending on the needs. First you need a general interpolation routine. I like

for linear ramps

y(t)=y(n+1)*f(t)-y(n)*(1-f(t))

where:
y(t) is the current temperature set point
y(n) is the temperature at time x(n)
f(t) = t-x(n)/((x(n+1)-x(n)) // always 0...1

for 3rd order ramps, s-curves

f(t) = t-x(n)/((x(n+1)-x(n))
f3(t) = (3-2*f(t))*f(t)*f(t)
y(t)=y(n+1)*f3(t)-y(n)*(1-f3(t))

The derivative at x(n) and x(n+1) will always be 0.

A similar affect can be achieved using the cosine function

y(t)=A*cos(B(t))+C
where:
A = (y(n)-y(n+1))/2
B(t) = pi*(t-x(n))/(x(n+1)-x(n)) // Like above, works only between x(n) and x(n+1)
C = (y(n+1)+y(n))/2

again the derivative at x(n) and x(n+1) is 0.

Cubic interpolation between the 2 middle points of 4 using Lagrange interpolation. This is not the easiest nor the best but it follows a pattern which allow one to expand it to cover any order of interpolation they want.

http://en.wikipedia.org/wiki/Lagrange_polynomial

Some prefer this method

http://en.wikipedia.org/wiki/Newton_polynomial

The end result will be the same. The Lagrange and Newton method are just two ways of calculating the same thing. Both method allow for non-zero derivatives at the knots but the first and second order derivative may not be smooth or continous. Cubic splines are required for that. I wouldn't attempt that unless you have access to ST ( I think you do ).

It looks to me like the first few methods will work and that you

I would have thought that you could get the result from the cam table. What if you ran a virtual axis. Couldn't you get the target position? It has been 8 years since I have played with the ControlLogix's motion commands.

Other tricks that can be used. One is to calculate the derivative at each point. Then one can generate a 3rd order curve between the two points because there are 2 temperatures and 2 temperature rates ( 4 knowns ) for the for unknows which are the 4 coefficients for a 3rd order polynomial. This is handy if you need to mix a combination of curved and linear segments and the first derivate must be continuos at the knots.

Let us know what options you like.
 
Alan Case said:
Hi.
PLC = Contrologix
I welcome any and all advise

Well my approach is very simple, this is what i did in a system that has to lower the temperature of edible oil during at least 21 hours.
You have to use V16 and there is an AOI instruction called DT differential time( download it from AB web page), this AOI makes a substraction between starting time and current time, so that its result is used to count time for your process.
I wrote an array begining with the highest temperature, i used a data in the array for every 5 minutes( from the AOI instruction), i do not know about your case.
The data from the array is replaced in the equation depending on time transcurred.
I see in your profile you only have two slopes one is positive the other one is negative( you have to have other two arrays each for the slope being used,) so you need only one equations for the setpoint, you have to be carefully when setting up the arrays, i did it in excel and then copied them to the plc.
You replace data in the equation depending on time.
 
Alan Case said:
Peter had a suggestion of cam tables using time instead of position but I cannot see any way to access the data in a cam profile.
This would be my initial inclination.
Use a MATC instruction and create a virtual axis to be the slave.
Scale the virtual axis in degrees.
Use the actual position or the command position (same thing for a virtual axis) as the setpoint for the temperature PID.
You can then also chose linear or cubic interpolation between points.
 
Hi. Thanks for the comments and after a bit of though I have decided to use the motion commands with a virtual axis. I will keep you informed of the outcome.
Regards Alan
 
Something to remember - the points in the cam profile are not absolute. They are relative to whatever position (temperature) you start at.

As Peter hints, actually following the profile is a separate problem.
 
Hi Peter.
It will be quite hard to follow the profile accurately. Heating is via SSR controlled heating elements, with cooling via VFD fans. There are also circulations fans if there is an excess temperature differential accross the zone.

I have quite a nice curve being generated now as a virtual axis, only problem is that the cubic interpolation causes an minor undershoot and overshoot on the transition of temperature setpoint. I know I am quibbling here as it is only between 0.7 and 0.3 degrees but is there a way to get rid of this other than manipulating the "cam array" values in the MCCP function. ie subtract or add the error to the required setpoints. The temperature control will not be as accurate to be worried by this minor deviation but it would be nice to start with a spot on profile.

Gerry, I found the values are relative, homing the axis to the start setpoint fixed that.

Regards Alan
 
Last edited:
Is the error caused by derivatives at the knots != 0?

Alan Case said:
Hi Peter.
It will be quite hard to follow the profile accurately. Heating is via SSR controlled heating elements, with cooling via VFD fans. There are also circulations fans if there is an excess temperature differential accross the zone.

I have quite a nice curve being generated now as a virtual axis, only problem is that the cubic interpolation causes an minor undershoot and overshoot on the transition of temperature setpoint.
Are you saying the derivative at the points at the end of the segments are not 0? That is I mentioned the derivatives above. Cubic splines don't normally allow you to specify the derivative at the knots ( the points in the table ). By looking at your .jpg I thought this is what you wanted. Which is why I suggest the cam table first. However, the profile should go exactly though the points you specify.

I know I am quibbling here as it is only between 0.7 and 0.3 degrees but is there a way to get rid of this other than manipulating the "cam array" values in the MCCP function. ie subtract or add the error to the required setpoints.
Now if you were using a Delta product we have an option so even our cubic splines have an option to force the derivative to be 0 at points that are at a maximum or minimum with respect to the two adjacent knots. :)

The temperature control will not be as accurate to be worried by this minor deviation but it would be nice to start with a spot on profile.
Are you saying the path doesn't go through the points or the derivative at the points is not zero. This isn't clear.

My cosine or cubic interpolation forces the derivatives at each point to be 0.

If you know the derivatives at each point you can calculate some feed forwards values that will reduce the errors significantly just like they would on a motion control.
 
Last edited:
Have you looked at the FBD instruction RampSoak (RMPS)? That would do what you are asking, but it is complicated (lots of features). I have written something for the SLC that will act as a Ramp/Soak controller.

You could probably use some math and chain 2 of the RMPS instructions together to get your saw tooth you are looking for.

Darren
 

Similar Topics

I’m attempting to send a temperature from a SLC-5/02 to an EZiMarquee display. The vendor said to use a MSG instruction to send the data to the...
Replies
1
Views
81
Hi!! I'm looking for Temperature rise calculation software from Rockwell, I just download "Product selection toolbox 2022" but this software is...
Replies
1
Views
210
I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
13
Views
603
I am looking for temperature/humidity sensor recommendations. Would like the sensor to display temp and humidity. Need to connect to a Contrologix...
Replies
4
Views
226
I have an old Chinese Temperature PID controller XMT 8038c2kp that am able to send and receive requests via Modbus poll test center in this format...
Replies
0
Views
442
Back
Top Bottom