Home Brew Forums (http://www.homebrewtalk.com/forum.php)
-   Automated Brewing Forum (http://www.homebrewtalk.com/f235/)
-   -   Pano-Matti, my Arduino based controller (http://www.homebrewtalk.com/f235/pano-matti-my-arduino-based-controller-374024/)

 Vesku 12-13-2012 09:36 PM

Pano-Matti, my Arduino based controller

 Vesku 12-26-2012 09:07 PM

Im assuming you are using the Arduino PID library in your code, Im doing the same and about to finalize my build. Ive heard people have had trouble setting the parameters for the PID, any chance you can post what your coefficients are.

 Vesku 12-29-2012 09:59 PM

I don't use the PID-library. I've my own simple algorithm that calculates the heating power (pump ON-time, I've a counter-flow HERMS) based on the wort and mash temperatures. I like it this way, I can set the heating ramp what ever way I want. I've another script that takes control when the mash temperature is in "range".

The ramp is done like this:
// offset < 5C
if (setTemp/10 - mash < 5)
{wortOffSet = 5;} ... and so on, as many offsets as is needed, I've 5.

The pump-ON time limiter:

if (onOff == 1 && lastPumpRun > 0 && (millis() - lastPumpRun) > 3000 && (setTemp/10 - mash) < 0.5) // after X sec pump off
{
bigPumpOff();
onOff = 2;
pumpRun = millis();
}
if (onOff == 2 && (millis() - pumpRun > 30000)) // after X sec pump back on
{
onOff = 0;
pumpRun = 0;
}

 crane 12-31-2012 03:55 PM

Quote:
 Originally Posted by Vesku I don't use the PID-library. I've my own simple algorithm that calculates the heating power (pump ON-time, I've a counter-flow HERMS) based on the wort and mash temperatures. I like it this way, I can set the heating ramp what ever way I want. I've another script that takes control when the mash temperature is in "range".
This code doesn't make sense, most likely because your not showing enough of it. Lets break it down.

Quote:
 The ramp is done like this: // offset < 5C if (setTemp/10 - mash < 5) {wortOffSet = 5;} ... and so on, as many offsets as is needed, I've 5.
It looks like you have different offsets depending on how far your actual temp is from the setpoint? What do you do with wortOffSet? What are your other offset values? Is it 4 when you are within 4 degrees?

Quote:
 The pump-ON time limiter: if (onOff == 1 && lastPumpRun > 0 && (millis() - lastPumpRun) > 3000 && (setTemp/10 - mash) < 0.5) // after X sec pump off {bigPumpOff(); onOff = 2; pumpRun = millis(); } if (onOff == 2 && (millis() - pumpRun > 30000)) // after X sec pump back on { onOff = 0; pumpRun = 0; }
Ok here you show part of a functional state machine except this on isn't functional because you are missing a state. Somehow you start with onOff = 1 but you never show how it gets set to 1. Similarly you don't show your state where onOff = 0. I'm assuming that you set onOff to 1 at the end of that state, but what else do you do in that state?

Step back and give us a higher level description of how your system works. Are you keeping your heating element on 100% of the time and regulating your mash temp by turning on/Off a pump that circulates wort through a HERMS coil?

The videos you posted are a little hard to follow. You show a lot of stuff really close up but you never show how things are connected or even a clear shot of your control panel to see what you are using for input. Are you using a rotary encoder like the brewtroller or a set if discrete buttons? How is your system plumbed, number of pumps, valves, etc?

 BenS 12-31-2012 04:10 PM

I agree that after watching the videos I don't particularly understand how your system software works, but they do a good job of showing that it works very well. I particularly like your setup of a hood that fits directly over your boil kettle. It's a very good idea that I might steal.....

 Vesku 01-01-2013 08:57 AM

This is my 1st ever software that I've done ... there's about 2000 rows of code, I'm not going to share that here, but I hope that even a part that doesn't make any sense makes someone think better ways to do it :drunk:

I use 2 sensors to control the mash temp ... The wort off set depends how close to the setpoint the mash is.

Here's more, this should be easy enough to understand? :) :) ;)

 Vesku 01-01-2013 09:16 AM

Quote:
 Originally Posted by crane (Post 4731637) It looks like you have different offsets depending on how far your actual temp is from the setpoint? What do you do with wortOffSet? What are your other offset values? Is it 4 when you are within 4 degrees?
The actual control is done by wort and mash temperatures. This one controls how much hotter than the setpoint (for the mash) the wort can be.

Quote:
 Originally Posted by crane (Post 4731637) Step back and give us a higher level description of how your system works. Are you keeping your heating element on 100% of the time and regulating your mash temp by turning on/Off a pump that circulates wort through a HERMS coil?
It's a counter flow HX herms. I'm using pump to control the heating. Of course there's a basic ON/OFF control for the heat source too (HLT).

Quote:
 Originally Posted by crane (Post 4731637) The videos you posted are a little hard to follow. You show a lot of stuff really close up but you never show how things are connected or even a clear shot of your control panel to see what you are using for input. Are you using a rotary encoder like the brewtroller or a set if discrete buttons? How is your system plumbed, number of pumps, valves, etc?
Sorry, I suck with the camera / editing.

I've small array of buttons, UP/DOWN/OK/LEFT/RIGHT. It's under the display. They are all behind one interrupt.

There's going to be a 3rd pump dedicated to the whirlpool as soon as my scrapyard dealer gets one that is suitable.

 Vesku 01-02-2013 09:42 PM

A plot of the latest mash. One of the temp probes is playing up and dropping to zero once in a while, I need to replace that.

 Vesku 12-01-2013 07:47 PM

There's been a few updates with this project anyway and more to come too.

The interface is now handled trough touchscreen + PC (the LCD + arduino's keyboard are still there for backup, but not for long, it's so much easier to do things trough Meguno). MegunoLinkPro just came out with a new version of their Interface Panel http://www.megunolink.com/. I just had my 1st go with it and it's just great, ok, there's a few minor hick ups still to fix and the documentation is on the thin side at the moment, but still big thumbs up for them :

I need to add another page or tab for all the mash temp settings etc.

Here's how it looks in the real life:

The plotting has improved too since the last pictures I shared in this thread:

Another cool gadget that I've added to the system is a scale under the mashtun. There'a a small amplifier/AD-module available to the Arduino that makes it easy to do this. http://www.elecrow.com/sensors-c-111/others-c-111_146/weight-sensor-amplifier-hx711-p-715.html
I used load cells from a cheap digital scale, they work just fine. It's a really accurate way to measure volumes, a lot better than the flow meter that I used before (it had to be calibrated, if the flow changed). The plywood triangle is the scale:
I can measure the grains with it too and I guess I could calculate a ruff estimate how efficient the mash was based on the weights before and after it.

The HERMS is now CF-HERMS and it's controlled with PID's (Arduino), but that's been covered in the other thread.

All times are GMT. The time now is 04:40 AM.