Timers, continued from previous state problem

Describe your system and processes, and post your config file.
Post Reply
thor
Posts: 3
Joined: Fri Nov 19, 2010 7:41 am
Bot?: No

Timers, continued from previous state problem

Post by thor »

Let me start out by stating that the BCS-460 is very cool and I'm just getting started so bare with me.

I've found a little issue with the timers and specifically with the flag for continue from previous state. I am trying to program an accumulated time for fly sparging so I can keep tabs on how long I've been Sparging. There are two basics states for this in my program. One is Sparge and the other is a pause when the float in the sparge tank is activated when the water is too high. The process loops around these two steps until a condition is met called done sparging (manual) or a float set in the brewing kettle is activated.

So here is my issue. If I set the initial timer in Sparge step (state 5) for init value 0 and not set continue from previous state (state 4) and the following step called Sparge pause (state 6) to continue from previous state, it zeros out the timer ever time it goes to Sparge step (state 5). If I set the sparge step (state 5) for continue from previous step and the pause sparge pause (state 6) step too, it also fails because there was no sparge timer set in the step prior to Sparge (state 4).

So I came up with a kludge I thought might work. The step before my sparge step is a Mashout rest of 10 minutes (state 4). So I purposely set the sparge timer for a 10 minute countdown just like the Mashout timer. I figured if it did this it would be zero when it got to the Sparge step (state 5) and then I could use continue from previous step to start counting up. Problem is it just keep counting down even though I tell it to count up in state 5.

The solution for me would be to have the controller automatically use a zero value for the timer in cases where there where the timer wasn't set in the prior step. I don't see any other easy work around.

Confused yet?
User avatar
ECC
Posts: 676
Joined: Fri Sep 12, 2008 12:29 pm
Bot?: No
Contact:

Re: Timers, continued from previous state problem

Post by ECC »

Yes, makes total sense :). I see the confusion, the persistent timers not only take the value from the previous state, but the up/down control as well. Think of it as a "Keep Going" setting.

One way to get the desired behavior would be to insert a Start state before the loop, to initialize the timer and start it counting. then it could transition to the looping state, each of which would have the persistent timer flag enabled.

Another perhaps cleaner way would be to use Ladder Logic to do the sparge. You could have a single sparge state (with timers) turns on a Register, which in turn enables a rung of the ladder to turn on the pump when the DIN is on as well.

Registers can be turned on in a state by state basis, and are one of the means to communicate with Ladder Logic;
sparge_reg.jpg
sparge_reg.jpg (22.93 KiB) Viewed 2469 times
This shot shows when the state turning on Reg0 is active, but the DIN (float switch) is off. The Green line traces the 'power'.
sparge_off.jpg
sparge_off.jpg (23.51 KiB) Viewed 2469 times
And now, the float switch is active, which allows the 'power' to energize the output;
sparge_on.jpg
sparge_on.jpg (25.46 KiB) Viewed 2469 times
Post Reply