Raspberry Pi Still Contoller

Fittings, parrots, packing, tooling and so on.

Moderator: Site Moderator

Mr Sippy
Bootlegger
Posts: 117
Joined: Wed Dec 28, 2016 3:54 pm

Re: Raspberry Pi Still Contoller

Post by Mr Sippy »

bluefish_dist wrote: Thu Jan 21, 2021 7:49 am If you are trying to run azeo, atmospheric pressure can cause issues.
As a potstill guy, I hadn't considered the effect of pressure in the region of azeo. So I ran two data sets of min/max pressure over the last 12 month period through the calculator. One data set near Galveston (Hobby airport) and another at Colorado Springs airport.

The results shown are for 95% ABV (ABV @ 20C)
Galveston (elev 46 ft) Colo. Springs (elev 6200 ft)
min 29.49 BP 77.8 min 23.49 BP 72.1
max 30.61 BP 78.8 max 24.19 BP 72.8

Not much relative temp difference from the hypothetical 9% wash posted earlier. However, as bluefish_dist points out, maintaining equilibrium in changing conditions is more challenging than I would have thought. Also consider the min/max are extremes that don't even occur in the same month. A hourly change would likely reflect a much narrower temperature range that a power management routine would have to contend with.
TimothyChurch wrote: Thu Jan 21, 2021 11:46 am Do you have any idea where to find the equation for the correlation between the two? As I improve the software, I think that will be one of the first points for improving the data.
Correlations are in Antoines and Raoults equations, plus an activity coefficient model for accuracy- several to choose from.

Cheers

edit: formatting went to hell :(
Last edited by Mr Sippy on Fri Jan 22, 2021 6:06 am, edited 1 time in total.
Be Kind, Tell the Truth, Sip Good Whiskey
User avatar
bluefish_dist
Distiller
Posts: 1502
Joined: Fri Jan 16, 2015 10:13 am
Location: Eastern Ia

Re: Raspberry Pi Still Contoller

Post by bluefish_dist »

Really in over 100 runs, I only had an issue once. But my vodka runs were between 8 and 10 hrs, so the one time a big front came through it shifted my set point by .1 or .2 f. Not much, but when trying to hold above 190.5, it matters. The normal day to day variations, I simply used a different set point for each run. I found it varied no more than 1 deg, so I would just see where I would stabilize for that day then run at that temp. Was too lazy to do the research and plug in the daily air pressure. Would have been easy as I was right next to the airport.

FWIW I believe the still dragon electric parrot has a pressure sensor for this reason.
Formerly
Dsp-CO-20051
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

The controller wiring is complete!
20210122_234058.jpg
On the side, I have 8 RTD input ports and 4 relay output ports. The first two are powered with 12V and the other two are wired directly so I can input whatever voltage I need in the future (Ignoring that I misplaced one 4pin connector so port 4 isn't connected..... :shock:)
20210122_234116.jpg
I did a quick test of everything.
20210124_004546.jpg
Most things worked perfectly. The exceptions being RTD 1 & 3 aren't reading correctly. I think there is a loose connection somewhere.

Also, the 5 V power supply keeps cycling on and off. When disconnected from the Pi it runs fine, but as soon as I plug it in it begins to cycle. The system runs fine with the RPi plugged into the standard 5.1V/3.0A power supply so it isn't an amperage draw issue. I also ran it plugged in before installation without an issue.

Either way, I'm going to hopefully run a test batch this evening and work on troubleshooting the last hardware issues next week. I got everything sealed up for the coolant loop. Just need one more piece of heat shrink tubing for the valve solders and to solder the last XLR connection to that valve.

With luck, the system runs smoothly! I'm sure there will be plenty of bugs to go through but I'm hopeful!
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

bluefish_dist wrote: Thu Jan 21, 2021 5:41 pm Really in over 100 runs, I only had an issue once. But my vodka runs were between 8 and 10 hrs, so the one time a big front came through it shifted my set point by .1 or .2 f. Not much, but when trying to hold above 190.5, it matters. The normal day to day variations, I simply used a different set point for each run. I found it varied no more than 1 deg, so I would just see where I would stabilize for that day then run at that temp. Was too lazy to do the research and plug in the daily air pressure. Would have been easy as I was right next to the airport.

FWIW I believe the still dragon electric parrot has a pressure sensor for this reason.
If the issue is an atmospheric pressure issue, I wonder if I could just pull the local weather data to compensate instead of having to have a localized pressure sensor. It would be a lot easier to simply code that into the program!
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

Mr Sippy wrote: Thu Jan 21, 2021 5:20 pm
Correlations are in Antoines and Raoults equations, plus an activity coefficient model for accuracy- several to choose from.

Cheers
It is always great when you go to Wikipedia to pull an equation and they literally use what you are looking for as an example!

I'll have to play around with a few models and see about incorporating it into my Temp to ABV function.
Mr Sippy
Bootlegger
Posts: 117
Joined: Wed Dec 28, 2016 3:54 pm

Re: Raspberry Pi Still Contoller

Post by Mr Sippy »

For me, there was a considerable bit of learning. My activity coefficient is van Laar. Wilson is a better model though more computationally rigorous. I got tired of looking for the error :)

Have you looked at my VLE-calc program referenced earlier? It has much of what you're looking for. I also offered the code, which you may have missed. It's in C but at least you'll get some insight into the algorithms.

The depth to which you're approaching this: I strongly suggest using a vapor-liquid equilibria foundation. Using a data driven approach could end up with the tail wagging the dog. Just my 0.02.

I'm enjoying your build. Similar to mine.
Be Kind, Tell the Truth, Sip Good Whiskey
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

I did my first "sacrificial" bug testing run. It was a batch I planned on stripping so it was more of a slowly run strip.

The main issue I ran into was dephleg control. Even with different variations of hysteresis control and adjusting input water, the fluctuation around the set point was between 3-4 degrees C. I'm currently trying to think of a better form of control.

I was thinking of setting up a slower PID loop. Have the PID loop take readings ever say 5-10 seconds. From this PID proportional output, convert it to a on-off percentage. If after 10 seconds it says 0.34, I'd turn the valves on (bypassing) for 3.4 seconds and then off for 6.6 seconds. I'm thinking I might be able to get better control that way.

I'm open to other ideas! Obviously, a few others on the forum have used these valves for dephleg control (ie swede & olddog). Does anyone know how they were controlling them??
User avatar
Yummyrum
Global moderator
Posts: 7730
Joined: Sat Jul 06, 2013 2:23 am
Location: Fraser Coast QLD Aussie

Re: Raspberry Pi Still Contoller

Post by Yummyrum »

Olddog used a PID and monitored the coolant out temp as did swede .

I believe olddog tried monitoring vapour temp but conceded that Swedes method of monitoring coolant temp was better .

Theres a topic on CCSC . I’ll see if I can find a link to it .

Edit : this one .
http://www.coppercustomstillcomponents. ... =194#p1230
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

Yummyrum wrote: Mon Jan 25, 2021 10:33 pm Olddog used a PID and monitored the coolant out temp as did swede .

I believe olddog tried monitoring vapour temp but conceded that Swedes method of monitoring coolant temp was better .

Theres a topic on CCSC . I’ll see if I can find a link to it .

Edit : this one .
http://www.coppercustomstillcomponents. ... =194#p1230
Thanks! I was looking for that one the other day and couldn't find it!
20210126_101218.jpg
Here is the heat up from the other day with 25% ABV of some neutral.

The PID worked wonders! Forgot to get a photo of the fluctuation but it was great. Now it is with a set amount of heating input and a set amount of cooling so I might have to retune it come the summer when the city water is hotter. With everything running, it kept with .5C nice and stabilized!!

Still working out a few bugs. The UI had too many data point on it and was beginning to freeze up and become sluggish. Honestly, I don't need a measurement every second for each thing! I'll have those export to a database here soon. I set up an input limiter on all of the charts to only allow one reading every 4 seconds on everything except the dephleg which I set to every 2 seconds. The nice part is it does a great job of getting rid of the jitter you get from the sensor with the minor fluctuations.

Overall, I'm extremely happy with how this is turning out!
20210126_105508.jpg
One thing on my debug list was setting a limiter on the vapor temp reading on the vapor in the pot. I used the equation from the parent site to output what the vapor would be based on so that way it won't read too far off. I might have to give it a little wiggle room but we will see.

I'm running some UJSSM either tomorrow or this weekend to do another debug run. Once the base product is running, I'll start trying to make it pretty! :D Then comes all the eventual add-ons.
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

One quick note for anyone watching this project and curious about doing something similar.

The main thing I would change about this controller is the box itself. I think in the future with other projects I will separate the low voltage and high voltage into separate boxes. I'd have a box that solely was dedicated to the 240v element. It would house the contactor, emergency off switch, and ssr with a low voltage input over say a phone cable. This way you could shut off power to the element(s) without shutting down the Pi. Since they are on the same power line, I have to keep the system turned on to make changes to the software, access files, etc.

**I do unplug the element while doing this now! Don't worry!**

Plus this way I could actually set up the Pi controller somewhere well away and just run a handful of Cat6 cables to control the system. In an ideal world, I'd have the Pi box wired up with a dozen Cat6 ports. Each would have a ground, 5V, and 6 gpio lines. Similar to how the BrewPi Spark is set up but with more outputs and no lcd screen. I'd actually probably mount it behind a wall-mounted tv and wire it up for the display.

I figure with this setup, I could run a single Cat6 over to say the fermenters. Have some ds18b20s over one wire and a 4 relay board mounted there to control fermentation temps for 4 fermenters. Maybe run another line or two to my brewing set up and use the same pi for both.

Just my thoughts if I was starting from scratch now!!
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

Screenshot (27).png
PID for the dephleg control is working much better! While I'm still getting some fluctuation, it mostly stays within a degree which keeps the output ABV rather stable.

The system definitely works better with a sub 8% charge. This makes sense because with two plates you have to have very little reflux to get the abv down to 80%. I was getting a lot more volatility while it was starting up because the 15% charge really wants to come off closer to 87%. Honestly, if I wasn't doing this to work towards a commercial distillery, I'd just take off where it wanted to and call it a day! But American laws about collection ABVs don't really allow for that.

I can definitely see the benefits of those fancy stills that allow you to bypass plates!
Butch27
Swill Maker
Posts: 177
Joined: Wed Feb 10, 2021 4:07 am

Re: Raspberry Pi Still Contoller

Post by Butch27 »

Yummyrum wrote: Fri Jan 01, 2021 7:58 pm I may have posted this somewhere else but it was a brainfart I had a few years ago .

It consists of two parts , a measuring devise and a cuts jar filler .

In the measurement unit , there are two chambers that alternately fill to say 50mls and a float sensor ( in this case a photo interrupter triggers a micro to operate a servo which switches the fill from one to the other . A second servo operates a drain in each chamber so while one is filling , the other quickly empties .

DFD82975-98CA-4BC6-910E-6A29614210B6.jpeg
So now the distilate goes to the second unit which is basicqlly a servo driven feed to one of many cuts jars .
The first jar could be programmed to receive 100ml of foreshots , the next 5 jars get 400mls each of heads , the next could be a demijohn that collects 5 Liters before switching to small jars again .

Now I don’t endorse this as a method to run a still unattended ...: but it would be fun to watch .../ because with so much automation , somethings bound to fuck up :eugeek:
image.png
image.png (35.61 KiB) Viewed 915 times
That's looking kind of complicated. I think a tipping bucket would be much simpler and possibly more reliable. The volume may change a little as product density changes but I still think it would be close enough for these purposes. The micro controller would be programmed to count each time the magnet passes the reed switch.

image.png
Post Reply