Mash Cycle program

Describe your system and processes, and post your config file.
Post Reply
rcrabb22
Posts: 43
Joined: Fri Apr 30, 2010 6:33 am
Bot?: No

Mash Cycle program

Post by rcrabb22 »

****** I HAVE EDITED THIS POST TO SHOW MANUAL INTERACTION WHERE NEEDED *******


While waiting for some parts to arrive I wrote my Mach Cycle State Machine.
I might combine a couple of states later on but for now this helps me organize my thoughts.

PUMPA is now HLT_PUMP
PUMPB is now MLT_PUMP

Initial setup
VERIFY ALL VALVES CLOSED (Includes Boil Kettle (A.K.A. BK))
Hose from HERMs output valve on HLT attached to MLT recircIN
Hose attached to MLT_PUMP IN, other end loose
Hose from MLT_PUMP OUT valve to HERMs IN valve of HLT attached
Hose from HLT OUT valve to HLT_PUMP IN attached
Hose from HLT_PUMP OUT valve to HLT recircIN valve attached
Wort transfer hose attached to BK OUT valve, other end loose

PROCESS
Mash Cycle
• State 0: Ramp up of HLT.
Resources
Out0, HLT element under PID control using temp0 = HLT temp probe,
temperature at setpoint
Timer0: Elapsed time to reach HLT set point, init to 0
Timer2: Total Elapsed time for mash process, init to 0
Out1: HLT_PUMP recirculate HLT water for even temperature
Exit Condition, HLT temp >= HLT setpoint Goto State 1


Manual Actions:
Open HLT OUT valve
Open HLT recircIN valve
Prime HLT_PUMP
Start HLT_PUMP

• State 1: Dough In
Out0, HLT element under PID control using temp0 = HLT temp probe,
temperature at setpoint
Timer2: Total Elapsed time for mash process, cummulative from State 0
Out1: HLT_PUMP transfer measured strike water from HLT to MLT
Exit Condition: Web Input button activated to start mash after
dough in complete, Goto State 2

Manual Actions:
Stop HLT_PUMP
Close HLT OUT valve
Close HLT recircIN valve
Close HLT_PUMP output valve
Move HLT_PUMP hose output from HLT recircIN to MLT output valve
Open MLT output valve
Open HLT_PUMP output valve
Prime HLT_PUMP
Start HLT_PUMP
Use HLT sight guage to meter strike water transfer to MLT
When transfer complete stop HLT_PUMP
Close MLT Output valve
Close HLT_PUMP output valve
Move HLT_PUMP hose output to HLT recircIN
Open HLT_PUMP output vavle
Open HLT recircIN valve
Prime HLT_PUMP
Start HLT_PUMP
Add grain to MLT/Dough In
Attach loose end of MLT_PUMP IN hose to MLT OUT valve
Open MLT OUT valve
Open MLT_PUMP OUT valve
Open HERMS IN valve
Open HERMS OUT valve
Open MLT recircIN valve
Prime MLT_PUMP
Start MLT_PUMP
Enable START MASH Win Button

• State 2: Mash
Out0, HLT element under PID control using temp1 = MLT temp probe,
temperature at desired mash setpoint
Timer1: init to desired length of mash, count down to 0
Timer2: Total Elapsed time for mash process, cummulative from
State 0 and State 1
Out1: HLT_PUMP recirculate HLT water for even temperature
Out2: MLT_PUMP recirculate wort through HERMs coil in HLT to
maintain mash temp
Exit Condition: Timer1 <=0; Goto State 3

Manual Actions:
Monitor temps and adjust MLT_PUMP flow or PID setpoint as needed
Other duties as needed (out of scope of this process)

• State 3: Transfer 1st Runnings to boil kettle
Out0, HLT element under PID control using temp0 = HLT temp probe,
temperature at mashout
Timer2: Total Elapsed time for mash process, cummulative from
States 0, 1 and 2
Out2: MLT_PUMP transfer wort from MLT to boil kettle
Exit Condition: Web Input Button activated to start batch sparge
Goto State 4

Manual Actions:
Stop MLT_PUMP
Close ALL MLT valves including MLT_PUMP output valve
Close HERMs IN and HERMs OUT valves
Remove MLT_PUMP OUT hose and leave loose (in clean catch bucket)
Connect loose end of BK wort transfer hose to MLT_PUMP OUT valve
Open BK OUT Valve
Open MLT OUT valve
Open MLT_PUMP OUT valve
Prime MLT_PUMP
Start MLT_PUMP
When MLT drained, stop MLT_PUMP
Close BK OUT valve
Close MLT OUT valve
Close MLT_PUMP OUT valve
Remove BK wort transfer hose from MLT_PUMP OUT and leave loose in clean catch bucket

• State 4: Batch Sparge
Out0, HLT element under PID control using temp0 = HLT temp probe,
temperature at mashout
Timer2: Total Elapsed time for mash process, cummulative from
States 0, 1,2 and 3
Out1: HLT_PUMP transfer sparge water from HLT to MLT
Exit Condition: Web Input Button activated to start vorlauf;
Goto State 5

Manual Actions:
Stop HLT_PUMP
Close HLT OUT valve
Close HLT recircIN valve
Close HLT_PUMP output valve
Move HLT_PUMP hose output from HLT recircIN to MLT output valve
Open MLT output valve
Open HLT_PUMP output valve
Prime HLT_PUMP
Start HLT_PUMP
Use HLT sight guage to meter sparge water transfer to MLT
When transfer complete stop HLT_PUMP
Close MLT Output valve
Close HLT_PUMP output valve
Move HLT_PUMP hose output to HLT recircIN
Open HLT_PUMP output vavle
Open HLT recircIN valve
Prime HLT_PUMP
Start HLT_PUMP
Attach loose end of HERMS IN hose to MLT_PUMP OUT valve (previous loose hose in catch bucket)
Open MLT OUT valve
Open MLT_PUMP OUT valve
Open HERMS IN valve
Open HERMS OUT valve
Open MLT recircIN valve
Prime MLT_PUMP
Start MLT_PUMP
Enable VORLAUF Win Button


• State 5: Vorlauf
Out0, HLT element under PID control using temp0 = HLT temp probe,
temperature at mashout
Timer2: Total Elapsed time for mash process, cummulative from
States 0,1,2,3 and 4
Timer3: Init to 10 minutes, count down to 0
Out1: HLT_PUMP recirculate HLT water for even temperature
Out2: MLT_PUMP recirculate wort through HERMs coil in HLT to vorlauf
Exit Condition: Timer3 <= 0, Goto State 6

• State 6: 2nd runnings to boil kettle
Timer2: Total Elapsed time for mash process, cummulative from
States 0,1,2,3,4 and 5
Out2: MLT_PUMP transfer wort from MLT to boil kettle
Exit Condition: Web Input Button END MASH activated
at end of transfer;

Manual Actions:
At vorlauf timer expiration
Stop MLT_PUMP
Close ALL MLT valves including MLT_PUMP output valve
Close HERMs IN and HERMs OUT valves
Remove MLT_PUMP OUT hose and leave loose (in clean catch bucket)
Connect loose end of BK wort transfer hose to MLT_PUMP OUT valve
Open BK OUT Valve
Open MLT OUT valve
Open MLT_PUMP OUT valve
Prime MLT_PUMP
Start MLT_PUMP
When MLT drained, stop MLT_PUMP
Close BK OUT valve
Close MLT OUT valve
Close MLT_PUMP OUT valve
Remove BK wort transfer hose from MLT_PUMP OUT and BK

Enable MASH END Win button
End Mash Cycle
Last edited by rcrabb22 on Fri Sep 23, 2011 3:14 pm, edited 3 times in total.
clearwaterbrewer
Posts: 383
Joined: Wed Feb 09, 2011 3:43 pm
Bot?: No
Location: Clearwater, FL
Contact:

Re: Mash Cycle program

Post by clearwaterbrewer »

I would put your hose and valve interactions in there... may help you decide if you need another state or whatever, will help us see if you missed something...

-mike
User avatar
Baron Ken
Posts: 99
Joined: Fri Jan 15, 2010 2:50 pm
Bot?: No

Re: Mash Cycle program

Post by Baron Ken »

clearwaterbrewer wrote:I would put your hose and valve interactions in there...
I agree.

For example, between states 5 and 6, you have to switch a hose connection, correct? I would put a state in there that holds everything the way it was except turn off the pump that is recirculating through the HERMS (you need that one for pumping out the 2nd runnings I'm guessing) and have the exit condition be a win button that indicates you have finished switching hoses.

I had so many 'user interaction' states that I had to break them up into Heat Strike Process and Mash Process.
EDIT: actually, after looking at my current setup I have it back down to 8 states (but still have it broken into 2 processes). I had to have additional states for when I jumped to the next process (this was before the firmware update that fixed exit condition spawning a new process).
clearwaterbrewer
Posts: 383
Joined: Wed Feb 09, 2011 3:43 pm
Bot?: No
Location: Clearwater, FL
Contact:

Re: Mash Cycle program

Post by clearwaterbrewer »

Another option to an additional state is to use a Hand-Off-Auto switch to force a pump off when moving hose from HLT to MT, for example..
User avatar
ECC
Posts: 676
Joined: Fri Sep 12, 2008 12:29 pm
Bot?: No
Contact:

Re: Mash Cycle program

Post by ECC »

clearwaterbrewer wrote:Another option to an additional state is to use a Hand-Off-Auto switch to force a pump off when moving hose from HLT to MT, for example..
Or the Process Pause button. It will turn off all of the outputs controlled by that process while paused, which is handy for swapping hoses.
User avatar
ECC
Posts: 676
Joined: Fri Sep 12, 2008 12:29 pm
Bot?: No
Contact:

Re: Mash Cycle program

Post by ECC »

There's really no difference between State0:Ramp up of HLT and State1:Dough In. Both are holding HLT to a temp with the pumpA on. There's nothing wrong with that (especially if you want to insert an alarm or measure the ramp time), just pointing it out.

I think it looks very good!
User avatar
Baron Ken
Posts: 99
Joined: Fri Jan 15, 2010 2:50 pm
Bot?: No

Re: Mash Cycle program

Post by Baron Ken »

clearwaterbrewer wrote:Another option to an additional state is to use a Hand-Off-Auto switch to force a pump off when moving hose from HLT to MT, for example..
Thanks for that. I actually have Hand-Off-Auto switches for my pump and heater on my control panel. Sounds much easier than programming it (and possibly forgetting to change a temp setpoint between different beers), I just never thought to use them for that, doh!
rcrabb22
Posts: 43
Joined: Fri Apr 30, 2010 6:33 am
Bot?: No

Re: Mash Cycle program

Post by rcrabb22 »

ECC wrote:There's really no difference between State0:Ramp up of HLT and State1:Dough In. Both are holding HLT to a temp with the pumpA on. There's nothing wrong with that (especially if you want to insert an alarm or measure the ramp time), just pointing it out.

I think it looks very good!
Thanks for the input. I agree with your observation. I was doing this in 2 states to capture and record elapsed time for HLT ramp up for future reference. After I have some experience with my system I may combine into 1 state.
rcrabb22
Posts: 43
Joined: Fri Apr 30, 2010 6:33 am
Bot?: No

Re: Mash Cycle program

Post by rcrabb22 »

clearwaterbrewer wrote:I would put your hose and valve interactions in there... may help you decide if you need another state or whatever, will help us see if you missed something...

-mike
I will. Thanks for the current and future input
rcrabb22
Posts: 43
Joined: Fri Apr 30, 2010 6:33 am
Bot?: No

Re: Mash Cycle program

Post by rcrabb22 »

I should mention I was going to turn on and turn off the pumps with mouse clicks on the appropriate outputs so a state transition would not change the pumps running or not. I think will need to reconfigure hoses at every state change anyway. If I happen to be away from the brewery when mash timer expires for example, nothing really happens except HLT temperature set to mashout. When I get there I would manually stop the pumps to reconfigure hose(s) to drain the mash tun.

Does this make sense?
Post Reply