Loop within a loop.

Describe your system and processes, and post your config file.
Post Reply
User avatar
Charlie
Posts: 5
Joined: Wed Oct 28, 2009 3:26 pm
Bot?: No
Location: Shongaloo, LA
Contact:

Loop within a loop.

Post by Charlie »

I want to run an inner and outer loop type program.

Loop 1. Vourlauf pump. On 3 minutes, off 7 minutes. This is the outer loop.

Loop 2. Heat exchanger pump. If during vourlauf mash temp falls below set point activate the heat exchanger pump until mash reaches set point. This should occur only when the vourlauf pump is on, but ideally it would extend vourlauf time if mash has not reached set point when vourlauf is scheduled to end.

The times are a guess. I'll fiddle with them until I get what I want, but I'm not sure how to implement the program.

Can I do this with ladder logic? I can program in basic, Fortran, C and Cobol, but I don't know squat about ladder logic.

Charlie
"I'm not superstitious. I think it's bad luck." Niksun

http://www.maltmunchingmashmonsters.com
User avatar
ECC
Posts: 676
Joined: Fri Sep 12, 2008 12:29 pm
Bot?: No
Contact:

Re: Loop within a loop.

Post by ECC »

Hi Charlie. Anything using a timers is best implemented as a Process. You should be able to implement your function in a two state process. One or both of the states can control the temperature of the heat exchanger. I would recommend setting it up something like this:

Code: Select all

Process0: Vourlauf

State0: Vourlaufing
  Timer0: enable 3min Countdown 
  Output:Vourlauf Pump = Direct ON
  Output:Hex Pump = Hold at XX temp via Hysteresis control
  Exit Cond: if Timer0 <=0, goto State1:Wait

State1:Wait
  Timer1: enable 7min Countdown
  Outputs (none controlled)
  Exit Cond: if Timer1 <=0, goto State0:Vourlaufing
And if you want to add the additional functionality of 'extending' the vourlauf, you can easily add another exit condition to State1:Wait (exit back to state0 if temp<XX), which will keep the vourlauf going longer. I believe this accomplishes what you desire, but if I missed the mark just let me know and we can draw up something else.

Here is a little more info on programming if needed.
http://www.embeddedcc.com/wiki/index.ph ... rogramming
User avatar
Charlie
Posts: 5
Joined: Wed Oct 28, 2009 3:26 pm
Bot?: No
Location: Shongaloo, LA
Contact:

Re: Loop within a loop.

Post by Charlie »

Cool. Thanks!

I've been using the BCS-460 for almost 3 years, but just to control my electric HLT. Automated mash temp control is something I've been planning to do for almost as long. Everything gets done. Eventually.

Charlie
"I'm not superstitious. I think it's bad luck." Niksun

http://www.maltmunchingmashmonsters.com
Post Reply