Exact SP reached at end of heating ramp time

JustDaveIII

Member
Join Date
Mar 2003
Location
Rochester, NY
Posts
23
I’m going to startup a plc based heating / cooling reactor system in a week or so and need some advice.

There are two PID control loops. The outer one for Batch (reactor) temperature and an inner one for Jacket (circulation loop) temperature.

The circulation loop for the jacket gets heat via a steam heat exchanger and gets cooled via a chilled water heat exchanger. Both have proportioning valves to control how much heat/cool is put into the circulation loop.

So far so good. I’ve done this type of non-ramped cascade control a couple of times and many one loop control systems. Always been able to tune the loops so that there is minimal (if any) overshoot, comes to temperature quickly and holds to less than one degree C.

I intend to do tuning via the Ziegler Nichols Tuning Methods to tune the inner (jacket) loop.

The tricky part is that the customer also wants a ramp mode. Not just a dumb ramp where a setpoint and time are entered and the ramp takes over. But wants the operator entered batch temperature to be at setpoint at the exact end of the operator entered ramp time.

If I put in just a plain ramp function (which I’ve written as the one in the PLC is somewhat limited) then I know that there will be a lag during the ramp and a settling time at the end of the ramp where the temperature will come up to the final setpoint, but after the ramp time has ended. What the ending settling time is unknown until I start it up.

I don't need the actual temperature of the ramp to be linear.

I’ve read everything I could find here & on the internet for tuning but can’t find anything on calculating my ramps so that they come out correct. I’m thinking I need at least two ramp segments. One for say 85% of the total time interval and another for the last 15% of time. The setpoint for the first segment would be more than 85% of the ending batch setpoint, maybe 95%. Then I’d used the 15% remaining time to bring the temperature to 100% setpoint. I’m just guessing here. Maybe a third ramp interval is needed.

I know that I have to take into account the difference of the ending setpoint temperature and initial Batch temperature, knowing my process heating slope. Also I’ll know the steam temperature and heat exchanger transfer function. Ditto for cooling. I’m also thinking that I’ll use a different set of PID tuning gains for cooling vs heating, due to the different capacity of heat transfer. I can heat a lot faster than I can cool.

Can anyone give me some real world suggestions on calculating the ramp interval times & setpoints or should I start playing with two ramps after graphing the heating function, non-ramped and try a y-mx+b type equation? Any one had to do an exact ramp before ?

Thanks,
Dave
 
I believe this to be an excellent case for "Roll-yer-own"... No PID controller.

Damn, too much MAGIC (MGD) happenin' right now.
 
Ramps are easy

Fraction = elapsed time/total ramp time.

Fraction is a number between 0 to 1 while ramping. When the fraction is at or above 1 then the ramp is at the final setpoint.

SetPoint = Initial SetPoint * Fraction + Final SetPoint * ( 1 - Fraction ).

Exponential, sinusoidal, and polynomial ramps are all easy. Exponential ramps fit more closely what the system would naturally want to do.

SetPoint = K * Sepoint + ( 1 - K ) * Final SetPoint.

K = exp(-t/T)

where t is the scan time and T is the time constant. T should be 1/5 the desired ramp time. The ramp will get within %1 of the final set point after 5 time constants.

Again, T, the time constant, should not be quicker than the plant time constant.
 
You say you don't care actual temperature of the ramp to be linear... Make an open loop (just an idea)
You could use PID as you always do and just ramp the setpoint when operator
selects proper mode. Linear ramp is very easy if you have both initial and final points and of course
ramp time. Or maybe I misunderstood your post...
 
Last edited:
Peter Nachtwey said:
Fraction = elapsed time/total ramp time.

Fraction is a number between 0 to 1 while ramping. When the fraction is at or above 1 then the ramp is at the final setpoint.

Yes, this is what I did in my own linear ramp function.


SetPoint = Initial SetPoint * Fraction + Final SetPoint * ( 1 - Fraction ).

Shouldn't that be:

SetPoint = )Initial SetPoint * (1 - Fraction)) + (Final SetPoint * Fraction) ?

Using your equation and Initial SetPoint = 10 and Final SetPoint = 20, at Fraction = 0 I get 20 for SetPoint.




SetPoint = K * Sepoint + ( 1 - K ) * Final SetPoint.

Is Fraction (Time) missing ? Putting Fraction (Time) and Initial [SetPoint] in it would be:

SetPoint = ((K * Fraction )* Initial Sepoint) + (Fraction *( 1 - K )) * Final SetPoint.


K = exp(-t/T)

The PLC (DL-260) doesn't have exp() function so I'll code up the expansion series to calculate it.


where t is the scan time and T is the time constant. T should be 1/5 the desired ramp time. The ramp will get within %1 of the final set point after 5 time constants.

Scan Time = equation solve interval ?

Solve the euqations only 5 times ? Won't that result in step changes in the Setpoint ?

I don't understand what value changes in the equation every time it is solved. Something has to be the % of ramp time, going from 0 to 1.


Again, T, the time constant, should not be quicker than the plant time constant.

plant time constant ???

-Dave
 
JustDaveIII said:


Yes, this is what I did in my own linear ramp function.



Shouldn't that be:

SetPoint = )Initial SetPoint * (1 - Fraction)) + (Final SetPoint * Fraction) ?

Using your equation and Initial SetPoint = 10 and Final SetPoint = 20, at Fraction = 0 I get 20 for SetPoint.


You are right.


JustDaveIII said:



Is Fraction (Time) missing ? Putting Fraction (Time) and Initial [SetPoint] in it would be:

SetPoint = ((K * Fraction )* Initial Sepoint) + (Fraction *( 1 - K )) * Final SetPoint.

You had it right before. Fraction goes from 0 to 1 as a function of time, position or anything else. The Ks don't belong in this formula.

SetPoint = (Initial SetPoint * (1 - Fraction)) + (Final SetPoint * Fraction)

This is right.

Now you can ramp the fraction using: fraction = ramp_time/total_ramp_time.


JustDaveIII said:

The PLC (DL-260) doesn't have exp() function so I'll code up the expansion series to calculate it.

You can approximate K in by the formula T/(T+t) where t is the scan time is T is the time constant. This works as long as T is greater than 10 times t.


JustDaveIII said:

Scan Time = equation solve interval ?

Yes.


JustDaveIII said:

Solve the euqations only 5 times ? Won't that result in step changes in the Setpoint ?
The exponential ramp is solved continously.

JustDaveIII said:

I don't understand what value changes in the equation every time it is solved. Something has to be the % of ramp time, going from 0 to 1.



[/B]

Take the desired ramp time and divide it by 5 to get T. If you what to ramp from one temperature to another in 5 minutes then T equals minute. t is the update period. If you update the ramp every scan then you must use the scan time in minutes. If you update the ramp every second as you do the PID then t is 1/60. t and T must be in the same units. You can also use seconds if you want.
The exponential ramp will update the the set point each update period. The setpoint will increase rapidly at first then slower as the final setpoint is approached.
 
I'm still confused. For the life of me, I can't see what variable changes as time increases when the ramp is, uh, ramping up. I already have a function that calculates % of total ramp time done. It goes from 0 to 1.

Let's keep everything in seconds. The plc scan time is more than 10 times per second.

The total ramp time is 300 (50 minutes). So T = 60.

I want to get a new ramp value every second. So t = 1.

x = T/(T+t)

Nothing in the above formula changes. Same result every time. x = 60/(60+1) = 0.983

If t is really accumulated time, incremented by 1 every time the equation was solved, then x would only go from 1 [60/(60-0)] to .16666 [60/(60+300)} after 300 seconds.


Or does T change every ramp interval ? Does it go from 0 to 60 ? Using that when T = 1 then x = .5 and when T = 60 then x = 0.983 . That is quite a jump from zero at the start.

Can you see my confusion here ? I don't see any variable that changes in the equation. Somewhere the percent of ramp time done has to come into play.
 
I think you might be mixing and matching ramp techniques. Peter listed two ramp methods: a pure linear ramp and a ramp that approximates a first order response (similar to an exponential ramp). This is how a capacitor voltage changes in an RC circuit given a step change in voltage. It looks to me like you are taking elements from both and mixing them.

I will assume you want to go with the exponential ramp. The value you list as 'x' Peter lists as 'K'. So x = T/(T+t). This defines for first order filter constant, which ultimately defines how long it takes to reach the desired value. You are calculating this correctly as far as I can tell. The only question I have on this deals with 't'. Is this equation in a timed interrupt so you know that 't' is 1 second? You stated earlier that the scan time was actually closer to 100 msec. 't' needs to be the time between equation executions.

Now you want to apply 'x' to the equation:

Setpoint(n) = (Setpoint(n-1) * x) + (FinalSetpoint *(1 - x))

I added the n subscripts because it always helps me visualize what is actually going on. Setpoint is the per-scan setpoint that goes to the control loop. FinalSetpoint is the value you ultimately want to reach.
Assume that Setpoint and FinalSetpoint are equal at 100. Change FinalSetpoint to 300.
Assuming your value of 'x' is what you want, on the first scan you will get:


Setpoint(n) = (Setpoint(n-1) * x) + (FinalSetpoint *(1 - x))
= (100 * 0.983) + (300 * (1 - 0.983))
= 98.3 + 5.1
= 103.4


The next scan will yield:

Setpoint(n) = (Setpoint(n-1) * x) + (FinalSetpoint *(1 - x))
= (103.4 * 0.983) + (300 * (1 - 0.983))
= 101.6 + 5.1
= 106.7

This will continue until the per scan setpoint reaches the final setpoint.

I hope this helped.
Keith
 
I have a very nice linear ramp function already coded. I know what an expontial ramp looks like. No problems there.

It was Peters "SetPoint = K * Sepoint + ( 1 - K ) * Final SetPoint " formula where my trouble snuck in. I didn't realize the the "Setpoint" on the right side was the previous "Setpoint" result on the left side. presuming that it was "Initial Setpoint" as per the linear ramp equation and my initial reply.

That's what I've been asking about, since I couldn't see any variable that changed.

While I do have the expansion series calculations for e^x , I would have to do a bit of coding to use it in k = exp(-t/T) in ladder so I'll use k = T/(T+t).

kamenges, thanks for the reformatted equation with "Setpoint(n) = (Setpoint(n-1) ..." in it. That made it clear.
 
Ok, now that we have gone through all of this trouble..

Why. A PID will naturally provide an exponential ramp response to a step input.

See:Temperature Control Using a PID

Skip all the fancy computations and just look at the graphs.
One can see that this tuning is much better than the ZN tuning. It is much more stable and reaches setpoint faster. ZN tuning wastes money. ZN tuning may not follow your nice new ramps anyway.

Excel's LINEST function and ability to inport RSLOGIX's trend files make me wonder if one can do autotuning in Excel. I think it is possible.
 
Re: Ok, now that we have gone through all of this trouble..

Peter Nachtwey said:
Why. A PID will naturally provide an exponential ramp response to a step input.

Of course.

JustDaveIII said:
The tricky part is that the customer also wants a ramp mode. Not just a dumb ramp where a setpoint and time are entered and the ramp takes over. But wants the operator entered batch temperature to be at setpoint at the exact end of the operator entered ramp time.

The customer does not want to always to change the setpoint by a step amount. Sometimes, not all the time.

Customer also wants a ramp. A normal linear ramp of the setpoint will leave the process temperature lower at ramp time end, due to thermal lag, pid lag, etc.

The ramp doesn't need to be linear. But it must be a ramp. Can't just full open the steam (or cooling) valve.
 

Similar Topics

Good Afternoon , I have a question concerning the ADC option for Studio 5000 and Powerflex 525 drives . I have it set for all 17 drives in...
Replies
4
Views
3,031
I'll start off with admitting I have a lack of experience when it comes to servos, but the previous ones I've done have all been rather...
Replies
11
Views
4,840
Can someone help me? i want to know what is the exact time of the machine downtime. Which when i go the machine i can just take note of the time...
Replies
9
Views
2,261
Hello gentlemen, I know this from experience and I' interested in the theory behind it. Let's say we have two identical drives and motors with...
Replies
26
Views
9,648
We have a machine that has a huge brake and clutch. MX measures the travel of this with a dial indicator every month for a PM. It only moves a few...
Replies
2
Views
2,031
Back
Top Bottom