Brand New Build, Brand New to BrewPi

As the title suggests, I am planning a brand new fermentation chamber build, and I am zero experience with BrewPi. I have very limited coding knowledge that is all but forgotten from my schooling days. It is not a skill I practice or enjoy. This community is the reason I am looking to adopt the spark as my brew control solution. There seems to be an air of enthusiasm that has been around for some time.

I gather from my reading this board that BrewPi is a thing of the past, and I should focus on BrewBlox going forward. I will focus my questions around software, as that is my weakness.

This is my first post. To keep it from becoming a wall of text, I will end it here and add a separate post with more information about my build plans. Then come the questions.

Thank you all in advance for your interest and time.

I need a temperature control solution for a 1/2 bbl to 1 bbl conical fermenter.
I do not want to utilize a glycol system with a coil, for a few reasons, the most relevant being that this conical will live in a Florida garage (over 90% humidity, over 90*F except for a few short months).

I want to be able to bring the beer temp down to 32*F for a week at the end of each fermentation.
An enclosed refrigerator or freezer should perform that task and keep the conical from sweating up a storm.
My garage is a dirty place. The fridge/freezer would also act as a barrier to keep the conical clean.

My process includes chilling the wort with 85F tap water. I chill the wort down to ~90F and pump into the fermenter. The wort chills the rest of the way down to fermentation temps (~50F) in the fermentation chamber. This is driving my decision to acquire a freezer instead of a fridge. The increased hp of the compressor allows 1bbl of wort to chill ~50F in ~12 hours instead of ~24.

The plan right now is use a commercial freezer with a 1/2hp compressor.
The particular unit I am looking at, Avantco SS-1F-HC, has:

  • the compressor for cooling
  • a set of fans for circulation
  • a set of heaters for defrosting the evaporator coils, drain pan and hose
    The unit also has a couple of temperature sensors; one for the cabinet and one for the evaporator coils.

Wiring up 3 SSR’s for the different function and two temp sensors is easy.
Control of this system is where I would like to focus my inquiry…

With a Spark 3 and BrewBlox, I would like to replicate the unit’s included control system, as well as configure a specialized control of the fermentation cycle.

Let me start by describing the unit’s native function.

The built in controller monitor’s the cabinet’s temperature and enables the compressor and fans when the cabinet temperature reaches 7*F over the set temperature. The unit continues to enable the compressor and fans until the cabinet temperature reaches the set temperature. This is the normal operating loop.

Every 6 hours, the normal operating loop is overridden with a defrost cycle.
During the defrost cycle, the heaters and fans are enabled until the evaporator temperature sensor reaches 58F.
There is a maximum defrost cycle time of 20 minutes.
To avoid blowing hot air throughout the freezer when exiting the defrost cycle, the fans are disabled until the evaporator temperature sensor drops to 41
F.

I have done some searching on this forum and been able to find that a logical function block is in work and due for release soon. This is needed in order to have the fans enabled during heat and cool functions.

My specific questions follow:

Can BrewBlox be configured to have an override/interrupt to a temp program in order to run a defrost cycle every 6 hours?

If I configure BrewBlox to trigger cooling and heating based on the cabinet sensor, can I use another temperature sensor (evaporator) to disable the heating function? (to replicate the defrost cycle)

Can I configure a time limit (20 minutes) to this defrost cycle?

With the current available control blocks, I think you should be able to achieve the desired behavior pretty closely.

  • You’ll have a PID driven by the beer temperature, which drives a PWM block (period 40m) to drive the compressor. On the compressor, you can set a minimum ON time and minimum OFF time.
  • For the defrost cycle, you can use a second PWM block with a period of a full day, with a maximum ON time how long it takes to defrost. If it should be temperature based, you can try setting up a PID with the evaporator temp as input. Use only proportional gain and set a maximum value on the PWM of 3%.

You can set up a mutex to prevent the defrost and compressor running at the same time. You can separately configure the time to block the other actuator after turning off for both the compressor and the defrost.

The fans are probably already wired to be enabled at the same time as the compressor, I would just leave it like that.

I don’t think you need the logic block right now, but it will be added in the future indeed.

You cannot use the existing sensors, because we only support OneWire sensors.

That is great news and fast!!
Thanks for getting your thoughts out so quickly.

The fans are definitely wired separately.
As far as I can tell, they never run with the compressor off.
While the compressor is on, the fans run if the evaporator temp is 41*F or less.
From what I gather, this is to prevent the fans from making a mess of the dripping of the melted frost.

Jumping ahead to using this as a fermentation chamber, yes, I planned on having 3 temp probes inside (beer, cabinet and evap) and one outside just for logging that data.
Once or twice a year, I will need to warm up the fermentation chamber because the weather drops too low.
I was planning on using the heaters on the evaporator to provide the heat while running the fans to even out temperatures. That is why I was thinking of the logic block.

I think I have enough confidence in this plan to go ahead and spend the money for both the freezer and the Spark 3.
Once I have the goods on hand and start tinkering, I’m sure I will be back to get some more specific help on implementing what you’ve described above.
At this point, I need to get the interface in front to me to understand what I don’t understand.

Thanks again!

Yep, I’m confident it will work. If not, we will add some things to the software to make it work. This is a scenario I want to support.

1 Like

I’ve had a few days to brush the rust of my UNIX skills.
It’s way easier these days with the internet at your fingertips!
I’ve got a Pi 4 running Raspbian Lite along with Brewblox.
The interface is very slick. I’m impressed with how solidly reliable this has been from the moment the services were enabled.

I haven’t enabled Wi-Fi on either box and don’t plan to.
Wired Ethernet to the Pi as well as a USB power supply (on UPS).
USB cable between Pi and Spark.

Plan is to mount a SSR expansion board inside the fridge cabinet.
Two SSR’s (heater and fan) and 3 temp probes (beer, air and evap) connected to the board.

A single piece of cat5e (RJ12’s) leaving the cabinet to the fridge exterior, connected to a second SSR expansion board.
A SSR (compressor) and a temp sensor (ambient) connected to that board.

A single piece of cat5e (RJ12’s) connecting that board to the Spark in the next (air conditioned) rom. That is a ~10m cable. Should be no problem, but it does create and issue, I can move the Spark and Pi out to the fridge and run Ethernet along with PoE to the Pi.
I want to keep these guys on UPS even if the fridge is unpowered.

Sorry for the long post.
I’ve had some time to play with the system and digest your post with more understanding.
I have some questions I think may be of interest to us all.

This is basically what the wizard created for me. Only, the wizard set the PWM block to a period of 30m, not 40m.

Let’s say I put hot (90F) wort in the chamber, and after 30 minutes of cooling, the chamber is still not at its set point (50F). I assume the cooling would have run for 100% duty cycle for the first 30 minute period, and continue to run without interruption into the second period.
Is that right?

The wizard set up a minimum ON time (3 minutes) and minimum OFF time (5 minutes) for the actuator.
With that protection in place, what’s the effect of the varying the period?
Seems like we’re forcing the Spark to decide how much of this next 30 minutes the fridge needs to run to keep the beer cold enough.

The longer the period, the easier on the fridge compressor, due to the lower number of cycles.
Seems like a long period, say 60 minutes, is the place to start.
One could back off of that duration if the beer temp fluctuates more than desired.
Am I thinking clearly about this?

PWM with a 24 hour period and maximum On time of 20 minutes would enable the defrost cycle once a day.
If I set up a PWM with a 6 hour period and maximum On time of 20 minutes, would that guarantee that a 20 minute cycle starts every 6 hours?
Or is it possible for the On time for the PWM to be staggered somewhere throughout its period?

Is a PWM only allowed to turn On once during its period?

I am aiming for a temperature based defrost (with max On time).
I can set up a PID using the evaporator sensor as the input and set to 58F.
This thing will always want to add heat if the evaporator sensor is below 58
F.
If this is set up to drive the PWM described above, it will be granted a single opportunity (not to exceed 20 minutes) every 6 hours to achieve that goal.

If the chamber temperature is higher than 58*F, say for an ale fermentation or a diacetyl rest, the PID should output zero and the PWM result in a duty cycle of 0%.
So there is no need to disable this behavior based on beer or fridge temps.
Am I think clearly about this?

After playing with the mutex a bit, I see you can assign 3 client actuators.
I attached the compressor, the heater, and the defrost actuators to the same mutex.
Since the heater and the defrost are actually the same piece of hardware, this will keep that heater from running for too long.
Will the planned logic block apply logic to actuator outputs and drive an additional actuator?
Or is there a better way?

Here is another thought.
If the compressor is running when the defrost cycle enables, does the mutex prevent the heater from firing, but the defrost PID and PWM still happily carry out their chores?
If the compressor runs clean though the defrost’s 20 minute period, does that PWM happily conclude its period?
That effectively eliminates that defrost cycle.
And there are no gaurauntees that the defrost cycle will ever run.
Is that right?
Or is there more to the mutex?

Thanks.

I assume the cooling would have run for 100% duty cycle for the first 30 minute period, and continue to run without interruption into the second period.
Is that right?

Yes. Barring any active constraints, this is how it’d work.

The wizard set up a minimum ON time (3 minutes) and minimum OFF time (5 minutes) for the actuator.
With that protection in place, what’s the effect of the varying the period?

Having a longer period allows for a longer on time when the setting is < 100%. A PWM with a period of 10min and a duty setting of 80% would turn on for 8min, and then run into the minimum OFF time.
There is some compensation present in the PWM implementation, but you’d still end up with a PWM that can only manage duty settings of 100% and < ~50%.

Seems like a long period, say 60 minutes, is the place to start.
One could back off of that duration if the beer temp fluctuates more than desired.
Am I thinking clearly about this?

Your reasoning is correct. We put the number at 30 minutes for the default setup, but feel free to experiment to find the best balance for your system.

If I set up a PWM with a 6 hour period and maximum On time of 20 minutes, would that guarantee that a 20 minute cycle starts every 6 hours?

While I suspect this is likely, it is not guaranteed. The exact placement of ON/OFF parts of the period is an implementation detail that may change at any time. There already are various under-the-hood optimizations built in that can adjust invididual periods.
You’ll need @Elco to describe current implementation.

As a more practical consideration: a 6 hour period is very vulnerable to reboots. Period start times are not stored in persistent memory, and the PWM will start a new cycle after a reboot.

Normally, the impact of occasional cycle interruptions is minimal, because the system is based on measured temperature, and will adjust the PWM duty setting. We designed the system with this in mind: the controller will reboot if it encounters an error.
These watchdog-triggered reboots are a mechanism to ensure that the system remains stable even if encountering the occasional (and inevitable) bug.

Or is it possible for the On time for the PWM to be staggered somewhere throughout its period?

No and yes. A period will never have multiple ON phases, but it is possible that minimum ON + minimum OFF constraints on the actuator cause the physical pin to switch ON - OFF - ON - OFF within the space of a single period.
Again, exact behavior falls under implementation details.

If the chamber temperature is higher than 58*F, say for an ale fermentation or a diacetyl rest, the PID should output zero and the PWM result in a duty cycle of 0%.
So there is no need to disable this behavior based on beer or fridge temps.
Am I think clearly about this?

The theory is sound. The main objection is the fragility of its dependence on implementation details and 6 hour periods I outlined above.
Whether this is a viable implementation depends on how tolerant the timing interval for your defrosting routine is - can it handle the pessimistic scenario?

If the compressor runs clean though the defrost’s 20 minute period, does that PWM happily conclude its period?

We added some period stretching logic to deal with this edge case, and you’ll likely need a balanced constraint between cooling and defrosting PWMs.
For a definitive answer you’ll need @Elco.

And there are no gaurauntees that the defrost cycle will ever run.
Is that right?
Or is there more to the mutex?

The Balancer exists to deal with this weakness in Mutex designs.

Will the planned logic block apply logic to actuator outputs and drive an additional actuator?

Yes, that is exactly how it will work. Here I do have some good news: the next release will include the logic block. The firmware implementation is currently in review while we figure out UI design, and how to make boolean logic user-friendly.

1 Like

Actually, that is not true. The PWM is allowed to stretch the period to meet the correct average duty cycle in this case.
So a PWM with a 10min cycle and 1 min minimum ON time, set to 5%, would start running 1 min ON, 19 min OFF cycles eventually.

Yes, I agree. 60 min is fine. Shorter could give a bit tighter control, but will put more strain on the compressor.

Yes, ON time will be continuous. It will not turn on more often if not needed to meet correct average duty cycle (% on)

You’ll have a lot more options with the soon to be released logic block. Like only doing the defrost when your measured temperature exceeds a certain value.

1 Like