Raspberry Pi Still Contoller

Fittings, parrots, packing, tooling and so on.

Moderator: Site Moderator

User avatar
Yummyrum
Global moderator
Posts: 7652
Joined: Sat Jul 06, 2013 2:23 am
Location: Fraser Coast QLD Aussie

Re: Raspberry Pi Still Contoller

Post by Yummyrum »

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:
2DDB972F-B366-461F-87B5-9CE36A0C6519.jpeg
2DDB972F-B366-461F-87B5-9CE36A0C6519.jpeg (25.52 KiB) Viewed 2744 times
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: Fri Jan 01, 2021 7:58 pm
DFD82975-98CA-4BC6-910E-6A29614210B6.jpeg

2DDB972F-B366-461F-87B5-9CE36A0C6519.jpeg
That would be awesome! It would be like a still turned Rube Goldberg machine!
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

For those who are interested in the build, here is the part list for what I'm building!

Since I prefer to use hats with Raspberry Pi versus break-out boards, I bought these.

RTD Acquisition Card
https://www.etsy.com/listing/906133425/ ... _purchases

Relay Card
https://www.etsy.com/listing/906133367/ ... _purchases

The whole assembly with be mounted on a DIN rail with these.
https://www.etsy.com/listing/892206576/ ... _purchases

The power supplies for the Pi and the Valves
12V - https://www.amazon.com/gp/product/B00DE ... UTF8&psc=1
5V - https://www.amazon.com/gp/product/B005T ... UTF8&psc=1

The shut-off button and the contractor for the power to the whole system
Botton - https://www.amazon.com/gp/product/B07R8 ... UTF8&psc=1
Contactor - https://www.amazon.com/gp/product/B08GX ... UTF8&psc=1

Valves for dephleg control
Normally Open - https://www.amazon.com/gp/product/B00DQ ... UTF8&psc=1
Normally Closed - https://www.amazon.com/gp/product/B01N0 ... UTF8&psc=1

Needle Valve for flow control to the whole system
https://www.amazon.com/gp/product/B07PX ... UTF8&psc=1

Finally, a case to put it all in
https://www.amazon.com/gp/product/B07PD ... UTF8&psc=1

There are other misc items like XLR connectors for wiring, the RTDs, SSR, and whatnot. Most of that I already have available at home. The bulk of the supplies should be arriving by next week! Then I'll finally be able to put everything together and start working out the bugs in the software! I'll make sure to take photos of the build process while I'm going through it.
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

Well unfortunately the USPS deemed my mailbox not secure enough for my last package and so I have to go pick it up from the post office tomorrow. Hopefully, I'll be able to start some basic calibrating and debugging next week!

In the meantime, I got to play around with my new load sensor!
20210110_230920.jpg
I'll need to get some calibrated weights to really dial it in but using 1L of water I've been able to get it dang close! The readings also have slight fluctuation but at the current calibration, the standard deviation is about 0.3g. I will probably collect data at the gram level so it doesn't bounce around and that should put me at close to an mL of accuracy.

I'm thinking of setting it up as a separate board and transmitting the info wirelessly. That way if my collection point is further away from my panel I don't have a wire I'm going to trip over. Plus it is another excuse for a project!
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

20210111_140817.jpg
The raspberry pi hats are in! Time to start testing the system before I put together the box and hook everything up!
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 have an open question for everyone. When collecting temperatures, obviously response time is important but having a smoother increase without bumps helps to program.
Temp Chart.JPG
I'm trying to figure out how much lag is acceptable in order to get a smoother curve. I projected out 3 options. The first was just the raw temp reading. The second is an average over the previous 5 seconds and the last is over 3 seconds. I was just holding it in my fist to heat it up. Now the 5 seconds is a really smooth line but at times was trailing almost a whole degree.

I'd assume once the temp was stabilized it wouldn't be too bad but you are still talking about a delay in action. What are y'all's thoughts??
User avatar
zed255
Distiller
Posts: 1021
Joined: Thu Jan 05, 2017 7:06 pm
Location: Ontario, Canada

Re: Raspberry Pi Still Contoller

Post by zed255 »

Not much happens in a still that 5 seconds would make much difference. I'd say whatever amount of time gets you a smooth response then use that, so if 5 seconds looks good, run with it.
----------
Zed

When the Student is ready, the Master will appear.
If you can't explain it simply, you don't understand it well enough.
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

Here is a better example of it close up. The probe randomly fluctuated 0.25C which made some serious spikes. 3 seconds smoothed them out and 5 seconds made it a brief plateau.
Temp 2.JPG
Do I go quick and reactive and perhaps risk cycling too much or smoother but a bit slower acting?
User avatar
RC Al
Swill Maker
Posts: 434
Joined: Sun Feb 11, 2018 12:40 am
Location: Sunny Queensland Oz

Re: Raspberry Pi Still Contoller

Post by RC Al »

Theres a big difference between the 3 and the 5, try 4?

It would depend on what your doing, if your fiddling with coolant or power the 3 might feel much less laggy for the user
User avatar
jward
Site Donor
Site Donor
Posts: 151
Joined: Mon Mar 30, 2020 2:06 pm

Re: Raspberry Pi Still Contoller

Post by jward »

Is the temperature actually changing or do the readings have jitter?
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

There is a slight jitter even with the 3-wire rtd. The system will be reading steady and it will have 3 or for spikes and then level out. Now they are only 0.2-0.25C of spikes so it isn't too bad. The only area I see there being an issue is the temp to ABV for vapor. A 0.2C jump can equate to 2.5% ABV difference when you are near azeotrope. I'm trying to see if there is a better way to filter it instead of average it maybe.

I dunno for sure. I'm also probably just being too over-analytical!!! :egeek:
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 think I figured out the jitter. I think it was just air moving in the room. Once I put the probe in liquid, the line stays much smoother and there aren't any jitters. I'm thinking once it is in a thermowell with thermal paste it shouldn't jitter so much.

Either that or I'm using it as an excuse to move to the next level and start testing the valve relays!
User avatar
Yummyrum
Global moderator
Posts: 7652
Joined: Sat Jul 06, 2013 2:23 am
Location: Fraser Coast QLD Aussie

Re: Raspberry Pi Still Contoller

Post by Yummyrum »

When I see it , I think electrical interference being picked up on the lead/ sensor . My first thought would be a low pass filter on the sensor input . Like simply put a 1nF or higher capacitor across the input and see if that smooths the spikes out .
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 11, 2021 4:08 pm When I see it , I think electrical interference being picked up on the lead/ sensor . My first thought would be a low pass filter on the sensor input . Like simply put a 1nF or higher capacitor across the input and see if that smooths the spikes out .
That actually worked great!!! In the smooth function of Node-Red, they had a low pass & high pass filter. I ran it through the low pass and played around with the value. I have it now where it trails within 0.1C on heating up and cool down and the 0.25C spikes are only 0.1C. Still slight spicks from the sensor but a much more acceptable amount!

Since it isn't a mean value, it also drops back down to the correct temp quickly when I do get spikes! Responsiveness without as bad of spikes! I say that is the winner!!! :ebiggrin:
lowpass.JPG
User avatar
jward
Site Donor
Site Donor
Posts: 151
Joined: Mon Mar 30, 2020 2:06 pm

Re: Raspberry Pi Still Contoller

Post by jward »

TimothyChurch wrote: Mon Jan 11, 2021 3:53 pm I dunno for sure. I'm also probably just being too over-analytical!!! :egeek:
That's the beauty of your controller. You can add any over-analytical stuff you deem necessary or valuable. Please keep sharing.
User avatar
SomethingObscure
Bootlegger
Posts: 146
Joined: Sat Dec 26, 2020 9:17 am
Location: England.

Re: Raspberry Pi Still Contoller

Post by SomethingObscure »

Hi Tim,

Ive never used a raspberry pi, but wonder if you'll get interference issues when you add the heating control system. And other hi frequency own systems.

Anyway can wait to see more.

Cheers SomethingObscure



“Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.”
-Albert Einstein

Sulaiman
Novice
Posts: 43
Joined: Wed Jan 18, 2017 6:36 pm

Re: Raspberry Pi Still Contoller

Post by Sulaiman »

I briefly considered automating my still
(ground joint chemistry glassware, 5l pot max.)
but getting my (any?) still in a reasonably stable equilibrium before take off begins will require complex control,
I doubt that it is worth the effort.

Then there is the collection phase,
this is where automation would be useful.
Once a few fractions have been reliably automatically collected you can comfortably use the toilet, get food or drinks, answer the door etc.
(does anyone really NEVER leave their still un-attended?)

the ending phase could be considered as an extension of the hearts collecting phase, with fractions, then shutdown.
OR manually manipulated for flavour profile.

Considering the consequences of construction or programming errors,
every step should be considered in a worst case scenario,
but if you did this, you'd never get started ;)
I think that you should treat it as an excellent learning experience,
but I'd trust manual control more :)

One thing that I found interesting was :
controlling heating power based on the pressure drop from the bottom to the top of the column
maintains the optimal vapour speed in the column.
(I've not tried, but you could, I hope that you do - I'd like to see it work)
Differential pressure sensors are cheap.
Accuracy not required, only repeatability is needed,
ie set equilibrium manually then press a key to maintain pressure difference.

In general, smooth/analogue/linear control is best as it will result in a more stable column.

Good luck, stay safe...

P. S. If you are going to get technical ;

- control requires power.
(how will the still behave if electrical control is 'lost')

- as atmospheric pressure changes with altitude and the weather, boiling points change.
(so you need an absolute pressure sensor
OR a reference temperature from boiling water)

- auto ABV measurement will require temperature compensation,
so a temperature probe of some type will be required in the collection vessel,
could be combined with an over-fill sensor that overrides the weight sensor?
Or a 'full' sensor to enable density measurement?
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

SomethingObscure wrote: Wed Jan 13, 2021 12:00 pm Hi Tim,

Ive never used a raspberry pi, but wonder if you'll get interference issues when you add the heating control system. And other hi frequency own systems.

Anyway can wait to see more.

Cheers SomethingObscure



“Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.”
-Albert Einstein
I'm hoping there isn't an issue. Since SSRs typically use zero crossing when turning on and off, I'm hoping it will cut down on any issues!
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

Sulaiman wrote: Wed Jan 13, 2021 4:37 pm Good luck, stay safe...

P. S. If you are going to get technical ;

- control requires power.
(how will the still behave if electrical control is 'lost')

- as atmospheric pressure changes with altitude and the weather, boiling points change.
(so you need an absolute pressure sensor
OR a reference temperature from boiling water)

- auto ABV measurement will require temperature compensation,
so a temperature probe of some type will be required in the collection vessel,
could be combined with an over-fill sensor that overrides the weight sensor?
Or a 'full' sensor to enable density measurement?
The way I look at this project is just an oversize PID controller with the ability to do more. I'm working with the strategy of running with the system taking over one job at a time until a balance of control and ease is reached (and then probably some more features just for fun!). Right now the base system is a PID with a simple on-off dephleg control and I'm sure it will grow from there!

I did make sure that from a safety point if power was lost coolant would continue to flow. The valve feeding water to the dephleg is a normally-open valve. As long as I don't have the whole coolant system turned down too low, it should put things back into full reflux until it is cooled down.

Now the points on pressure fascinate me! I honestly hadn't really considered that parameter. Primarily because I live in Galveston, Tx and my still is a whole 5-6 ft above sea level! We get a hurricane I watch the water rise up in my storm drain. Right now pressure here is 30.1 inHg with atmospheric being 29.92! Thankfully one less variable that should affect me. I'll still have to add it to the project board as it would be a good thing to have. Do you have a link to where you were reading about driving the element based on pressure? I was planning on running mine at a set manual level but I'd be interested to see how that could work.

As far as the auto ABV measurement, why would the temp of the collected spirit matter? If I was to drop a hydrometer in it, it would obviously be off if it wasn't at 20C, but I'm measuring the vapor temp at the head of the still. This way I'm looking at the ABV prior to it condensing. I could see pressure having an effect though.
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

All of the pre-assembly tests are done! All of the power supplies, valves, temp probes, and SSRs have all been tested. Now it is time to draw out where all of the connections will be. I've decided that even though I'm not using all of the inputs, I'm going to go ahead and wire them up. That way I can easily add valves or temp probes down the line.

It is finally time to start marking the box and drilling some holes!
User avatar
RC Al
Swill Maker
Posts: 434
Joined: Sun Feb 11, 2018 12:40 am
Location: Sunny Queensland Oz

Re: Raspberry Pi Still Contoller

Post by RC Al »

Sulaiman wrote: Wed Jan 13, 2021 4:37 pm Once a few fractions have been reliably automatically collected you can comfortably use the toilet, get food or drinks, answer the door etc.
(does anyone really NEVER leave their still un-attended?)
The first sentence is why these convo's get squashed FFS
Im on gas and I power off for all of the above, Get your stuff together before hand and have the rest delivered by lackeys.

Familiarity/Regularity breeds contempt, contempt wont keep the rain off your head or replace people/health in a worst case scenario
Mr Sippy
Bootlegger
Posts: 117
Joined: Wed Dec 28, 2016 3:54 pm

Re: Raspberry Pi Still Contoller

Post by Mr Sippy »

Now the points on pressure fascinate me!
Me too.

The min/max pressure over the last 12 months in my area was 731/749 (mmHg). Data is from the weather history at local airport. Per equations, 9% wash at 731mmHg boils at 92.3 - 9% wash at 749mmHg boils at 93.0.

In absolute terms, these calculation are empirical and therefore approximations. In relative terms a 0.7 degree fluctuation in BP for a given wash is probably not unusual.

I wouldn't even worry about daily changes unless you have a tropical depression bearing down on you. :)
Be Kind, Tell the Truth, Sip Good Whiskey
boomstick
Novice
Posts: 15
Joined: Sat Dec 26, 2020 3:17 am

Re: Raspberry Pi Still Contoller

Post by boomstick »

TimothyChurch wrote: Mon Jan 11, 2021 1:48 pm The probe randomly fluctuated 0.25C which made some serious spikes. 3 seconds smoothed them out and 5 seconds made it a brief plateau.
If its just jitter cant you filter that out by software?
Im thinking along the lines of comparing the last three samples and if the temp has moved in one direction and then back simply replace the jitter-value by the adjacent ones.
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

boomstick wrote: Thu Jan 14, 2021 10:36 am
TimothyChurch wrote: Mon Jan 11, 2021 1:48 pm The probe randomly fluctuated 0.25C which made some serious spikes. 3 seconds smoothed them out and 5 seconds made it a brief plateau.
If its just jitter cant you filter that out by software?
Im thinking along the lines of comparing the last three samples and if the temp has moved in one direction and then back simply replace the jitter-value by the adjacent ones.
That is actually one thing I was looking at the other day. I found a node in Node-Red called rbe and it allows me to block values based on their change off of the previous. I would just need to come up with the amount of change or percentage to use. The only thing it wouldn't do is to input the value with the adjacent values. I'm trying to figure out if I'd need to write a function for that or if the low band filter I'm using to smooth it would be able to compensate. Haven't had a chance to code or work on the box yet due to some work commitments. Hopefully will have more progress pics soon!
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

Time for the build to begin!
20210120_120905.jpg
20210120_122347.jpg
20210120_125327.jpg
20210120_132829.jpg
20210120_224600.jpg
I'm knocking out the controller first. Just wrapped up the 120/240V section of the wiring. Next, it is time to start soldering a lot of XLR connectors! I also had the last of the plumbing joints arrive today for the valves to the dephleg and product controller. I should have some good progress this week!
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

On the software side, I've decided that this is phase one of the project. Once the base of this project is functional I want to replace my brewery controller with a Raspberry Pi as well. Eventually use a Pi Zero for fermenter control! I already have a Pi for my tap list using another software but I could write a section for that. I'd like to slowly build out every aspect of a Brewstillery and roll it into centralized software. There would be one central server for storing the data and each of the devices would MQTT their data to it.

Heck, I could even set up a quick inventory of partial bottles with a scale to keep track of how much product is sold!

I have finally figured out the best way to set up GitHub and have renamed the project to Brewstillery-Control (https://github.com/TimothyChurch/Brewstillery-Control). The main branch will hold the latest working software while I use the development branch to play around with new ideas and features.

Hope this all works!!
Doctaf
Novice
Posts: 7
Joined: Fri Nov 27, 2020 10:26 am

Re: Raspberry Pi Still Contoller

Post by Doctaf »

Flipping epic m8! Im excited to see where this leads the hobby. Hope all is well.
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 »

Mr Sippy wrote: Thu Jan 14, 2021 3:57 am
Now the points on pressure fascinate me!
Me too.

The min/max pressure over the last 12 months in my area was 731/749 (mmHg). Data is from the weather history at local airport. Per equations, 9% wash at 731mmHg boils at 92.3 - 9% wash at 749mmHg boils at 93.0.

In absolute terms, these calculation are empirical and therefore approximations. In relative terms a 0.7 degree fluctuation in BP for a given wash is probably not unusual.

I wouldn't even worry about daily changes unless you have a tropical depression bearing down on you. :)
If you are trying to run azeo, atmospheric pressure can cause issues. I had a front rolled in one day, which changed the pressure enough that my still head temperature needed to be decreased to stay Above 190 proof. While I held temp all day, it needed to be decreasing due to the pressure dropping, so my abv went up almost enough that I had to rerun it.
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 »

bluefish_dist wrote: Thu Jan 21, 2021 7:49 am If you are trying to run azeo, atmospheric pressure can cause issues. I had a front rolled in one day, which changed the pressure enough that my still head temperature needed to be decreased to stay Above 190 proof. While I held temp all day, it needed to be decreasing due to the pressure dropping, so my abv went up almost enough that I had to rerun it.
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.
User avatar
TimothyChurch
Novice
Posts: 56
Joined: Fri Sep 12, 2014 2:24 pm
Location: Texas!

Re: Raspberry Pi Still Contoller

Post by TimothyChurch »

Since the plumbing joints came in, I thought I'd do a quick dry fit of everything to double-check the layout.
20210121_010145.jpg
The input is at the bottom of the product condenser and total coolant flow is control with a needle valve there
20210121_010152.jpg
At the top of the PC, the water flows straight to the dephleg or is diverted through a normally closed valve to the coolant discharge.
20210121_010206.jpg
On the dephleg, there is a straight input. On the output is a tee with a temp probe going in, this goes to a normally open valve. By closing this valve and opening the other, all water bypasses the dephleg.
20210121_010220.jpg
20210121_010228.jpg
The one point I didn't consider is the diameter of the probe versus the interior diameter of the 3/8 fittings. I'm going to see if I can find a 3/4 tri-clamp to 1/2 NPT in order to make more room. Currently, there is enough room for water to flow but there will be some back pressure due to the limited clearance. Also if I can get one that is shorter, I can actually get the probe into the dephleg. Currently, it sits just inside the output.
Post Reply