Mashing and RIMS - Time splitting between two elements

I have an all electric setup, but am currently limited to 16a service at 230v (3700W). I am looking for ways to make my brew setup more optimized with its power usage. Typically one would choose a HLT element and RIMS element such that when both are powered the total consumption is less than the circuit limit. However, I notice my RIMS tube is only fired maybe 25% or less of the time (currently running a 2000w element) once it is at temperature…maybe less time even. This leaves power available the other 75% of the time which is idle.

What I would like to do is have a 3500W element in my HLT, and a 2000W element in my RIMS tube, but only one of the elements can be on at a time. The priority would be on the RIMS tube, and leftover time would be available for the HLT element. I believe this can be done using regular PID controllers for each the RIMS and HLT and a couple logic operators such as below:

RIMS: Hook the RIMS PID signal direct to the RIMS SSR.

HLT: Run the RIMS signal into a logic inverter then to a logical AND along with the HLT PID signal. The logic AND output gets sent to the HLT SSR.

Implementing via hardware such as above is possible, but the logic (and timing delay requirements) could be simpler in software. Any idea if such logic could be implemented into the BrewPi Spark for mashing? :smiley:

1 Like

Actually, this is already in the software :grinning:
I had the same idea last year and wrote this:


The code works as follows:
If two actuators belong to the same mutex group, they cannot be active at the same time. You can configure a dead time in between switching from one to the other, which can be large (for a heater and a cooler) or very small (for two heaters with only limited current available).

Actuators request to be active with a certain priority, based on the PWM value. The actuator with the highest priority is activated. When it shuts off, the other actuator can go active. They can even overlap their PWM periods, so both running at 40% is fine.

We don’t really support driving 2 heating elements yet, mainly due to the data logging and interface code missing, but the code for overlapping 2 elements is already there and tested. Both in unit tests (see below), and by me while brewing.

When I start brewing, I heat up my boil kettle to the mash in temp, while keeping the HLT at temperature. The elements are both 3500W, but they alternate.

https://github.com/BrewPi/firmware/blob/develop/boost_test/ActuatorMutexTest.cpp

https://github.com/BrewPi/firmware/blob/develop/boost_test/ActuatorPwmTest.cpp#L403

To summarize: this has already been coded and as soon as you can control 2 heaters, you can also set them up to be mutually exclusive.

Great, so now the follow up question…:slight_smile: I don’t need the data logging, but some way of interfacing to it would be good.

When will it be possible to run 2 heaters? For now I have implemented the basic idea using two PID controllers and using an arduino to control the state logic to prevent both from turning on. This works but it needs some tweaking. If both PIDs are on the same time cycle and at 50%, the one without priority will simply not fire. Thinking of increasing the time cycle on the non-priority one to allow it to fire at least part of its cycle.

That is the idea now, that the priority manager makes sure they are distributed as even as possible (with ratio based on priority), up until mains supply 100% utilized. I have not worked on this part of the code in a while, so I might need to write up some more unit tests to ensure that is what it does.