"Temp Recipe"

kurt.brinker

Member
Join Date
Dec 2006
Location
In Town
Posts
263
I am making a "temp recipe" for one of our rooms and basically it is a simple 4 stage temperature control. They put in how long in minutes they want each phase to last and phase 4 holds its value until the temp control is disabled. upon disable, all timers will be reset.

I put this together. How does it look?
 
Might want to add range checking to your phase time, that way you can ensure that the number is less than 32767, and isn't a negative number. Moving a negative number to a timer preset will fault every AB platform that I know of. We often use the negative timer preset to test our fault routines.


Edit:
Will you every need to skip to the next phase before the current phase is complete?
 
Last edited:
sorry it took so long to get back with you.
I'm not familiar with range checking but can i make it so that the hmi input is limited to 1-545? That gives them a maximum of 9 hours per cycle right? I dont think we will need more than that but i'll know more tommorow. They didn't specify whether or not they would ever need to skip to the next cycle but i'll find out and add that if necessary. (I am pretty sure i can figure it out)
 
Take a look at http://forums.mrplc.com/index.php?download=576

I use similar code in vaccum furnaces where some segments are much longer than 9 hours, some run for several days (the routine in the linked download is for something else, but you can easily adapt it for very long timers.) It renders a floating point timer that does not accumulate error due to scan time (A timer/counter pair will totalize scan time into the accumulate time which can result in significant timer error over very long periods of time). The code could be adapted to use minutes as the time base as well. You have to do your own comparrison to know when the required time has elapsed.

For range checking all you need to do is use a LIM statement or GEQ/LEQ pair to check the result before moving it to the timer. You should determine how you want to respond if the value is out of range.

Edit: Here, take a look at this attachment. I made some changes to your program - I'ts hardly complete, but it will give you an idea of how I handle multi segment control for very long segments. Notice that I added two integer files to contain the temperature setpoint and the minutes for each segment as well as using a counter as a segment pointer and indirect addressing. This can be easily expanded to accomodate as many segments as you need, eg, to make a 100 step controller just change the counters preset and increase the size of N9 and N10 files. I hope it helps.
 
Last edited:
gonna take me a minute to decipher that but i found my original won't work whatsoever.
When the dn bit is set, it will start the next rung but on the next scan it will disable the previous rung and that will reset my timer which will make the dn bit false essentially enabling the prior rung.

back to the drawing board

edit: looking at your mods now
 
hate to say it, but i think what you wrote is beyond where i am at as a programmer. Most of what i know is self taught so my knowledge is very limited. I am going to look it over and hopefully i can begin to understand it. I'd hate to think you wasted time writing that out. the whole casting pearls before swine applies here.

I'll let you know what i come up with. Thanks again for your help.
 
I made a mistake in the file I attached to my previous post. I was in a rush to make it to a meeting and I neglected to proof read it. Rung 3 should look like this:

al050907.JPG
 
Kurt, how accurate do you need to be in your timing? Can you be off by a couple of seconds over a 24 hour period? Not every application requires precise timing and accumulated error of several seconds or even a minute don't really matter.


Maybe we can come up with a simple solution counting minutes that is easy for you to follow.


Also I noticed that I made a mistake in what I posted earlier, I was in a hurry to get off to a meeting and didn't proof read so make sure you see my other reply in this thread.
 
maybe this will help

Here is one possibility that builds on your first program. I substituted counters for the timers and used a single 1 minute timer. The counters count how many minutes have passed - so you can run each phase for much longer periods of time, up to 546 hours. I showed one way that you can do range checking and adjust the times for each phase automatically to be within a 24 hour limit.
 
just got back in the office so i am going to take a look at what you wrote.
The cooling is a very slow process and it takes a good hour to cool the room 10 degrees. the previous setpoint does not have to be made in order for it to change. They just want a new setpoint to automatically be set after XX hours with the 4th setpoint being the final.

i am going check yours out but i like the idea of using counters.
 
wow, i am constantly amazed by programming techniques and this is just another example of that. I completely understand what you are doing in the previous post and it makes perfect logical sense. I would have never thought about using counters but it makes things soo much easier. The range control, using counters, all of it is simply brilliant. this is definately going in my technique binder. I will post back up with my final version so you can browse it. I am going offshore friday and i'll be bringing my plc textbook from george brown with me. Hopefully one day I'll be the one answering the questions. Thanks again for all the help.
 

Similar Topics

The objective: Reach about 10’ horizontally into a 1300F furnace, and pick up a 140lb rectangular container, then pull the container back out of...
Replies
15
Views
1,781
Hi Everyone, We have Silo System which has temperature sensor and these sensor data will be communicating through RTU unit to the Dedicated PC...
Replies
2
Views
558
We have a small plastic parts oven (SP at 210F). It used to have an old bimetal temperature regulator. We are upgrading it using two temperature...
Replies
7
Views
1,494
We have a vertical Axis which was overheating while not moving. After further investigation I found that when the axis moves upward to a...
Replies
5
Views
1,145
Needing some help. I have a machine that was put in storage and has ended up in my lap. It had a 5/02 originally but the card was pulled and I...
Replies
3
Views
1,342
Back
Top Bottom