Spike Brewing 12.5 Conical Fermenter Giveaway - Enter Now!

Home Brew Forums > Home Brewing Beer > Automated Brewing Forum > Source Code Sharing for Raspberry, Beaglebone, and Arduino?

Reply
 
LinkBack Thread Tools
Old 10-20-2013, 08:36 AM   #21
vortexau
Feedback Score: 0 reviews
Recipes 
 
Join Date: Oct 2013
Posts: 5
Default

I have some Linux C++ code I've been working on for my automated brewery project up on Github: https://github.com/vortexau/OpenBrew It's Linux only, and uses GNU tools to build. It'll never be windows. Sorry.

So far it parses a BeerXML export from BeerSmith and generates the required steps as objects in the software and adds them to a 'vessel'. Other than that it doesn't do very much at all right now, certainly no relay control or anything like that. I'm using a BeagleBone (the white one) for the brewery and have some SSRs and a I2C relay board to handle the elements and the pumps. I'm intending to keep this thing semi-automated at best and keep manual valves, with the automation only controlling the temps of steps and the HLT, and adding the ability to have my HLT water at X temp at a time I pre-program into the system. I would like to implement gas boil control however, but that's down the track - I need to just get the HLT control and RIMS tube up and working at the very least!

I haven't done much with it for a while because I've been lazy. I have all the RIMS hardware etc but simply lack the time to get it all configured and working right now.

My other project is a RasPi fermentation fridge controller, which controls two fridges; i've actually just got the basic relay wiring up and running in the past few days.

I've also been working on an Android application that will be the UI for the brewery, and also allow me to monitor the fermentations I have going at that time. REST web services on the BeagleBone brewery and the RasPi fermentation controller serving the data to the Android application for the brewery and the fermenters.

__________________
vortexau is offline
 
Reply With Quote Quick reply to this message
Old 10-20-2013, 09:12 AM   #22
vortexau
Feedback Score: 0 reviews
Recipes 
 
Join Date: Oct 2013
Posts: 5
Default

i should also mention I wrote some Arduino software to control two fridges, again that code is also on Github, but it's abandoned. https://github.com/vortexau/ArduFerm Feel free to fork or download and do as you please. Consider it public domain.

I did some basic testing with that code and it does 40x4 LCD control too, but Arduino was just too restrictive for me - and once RasPi came out it opened my eyes to a whole world of Linux SBCs - and my Arduino's went in a drawer.

STC-1000's work well enough that i've not really bothered to put much time into these fermentation controller projects recently, but now I need to control a second fridge and I want to graph both of them - so my interest has lifted again.

ArduFerm output example:
ArduFerm Display by auvortex, on Flickr

Was just using rand in Arduino to generate the numbers.

__________________
vortexau is offline
 
Reply With Quote Quick reply to this message
Old 10-20-2013, 06:41 PM   #23
alien
Feedback Score: 1 reviews
Recipes 
 
Join Date: Apr 2012
Location: Philadelphia, PA
Posts: 1,234
Liked 65 Times on 58 Posts
Likes Given: 61

Default

Thanks for sharing the code!

From my point of view embedded chips are fine for temp control but the Linux boards are great for IO.

With multiple fridges I would be looking at embedded controllers communicating with a single BB/Raspi/router over RS485.

alien is offline
 
Reply With Quote Quick reply to this message
Old 10-20-2013, 09:09 PM   #24
vortexau
Feedback Score: 0 reviews
Recipes 
 
Join Date: Oct 2013
Posts: 5
Default

Thanks for the suggestions. RS485 looks like a reasonable solution when the devices are physically separate, in my case the fridges are directly next to each other so to me it makes more sense to keep it simple and just do everything on the RasPi.

__________________
vortexau is offline
 
Reply With Quote Quick reply to this message
Old 10-25-2013, 04:01 AM   #25
RickH
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jun 2013
Location: Princeton, Texas
Posts: 64
Liked 5 Times on 5 Posts
Likes Given: 5

Default

Oh, Here is an article that talks about the Raspberry PI interfacing to the relay module. The BBB would connect the same way. Depending on if its a pump or what it is and the load that relay module can handle a good load, for more than that I would connect the relay module to a SSR so that it can handle any large load. The relay module can fire the SSR like a PID fires it. It would just need voltage which after thinking about it I would use a separate power source in case of severe malfunction. But below is how I plan to run all the devices. I also want to make it so that in the beginning you can go into a "Setup" and "Add Device" and choose it from a list and basically Map it to which GPIO pin it is. Save it, go to a test screen where it will list all the devices that are inputs with the current reading, and outputs such as pumps and coils, etc, and you can hit a on or off button to have it fire that relay to make sure it is actually turning on and off what you think it should. That way when you tell it to keep a temp you know its turning on a heating element and not a pump, etc. That was my thought on how to handle a lot of it. I hope that made sense.

https://coderwall.com/p/izzsig

__________________
RickH is offline
 
Reply With Quote Quick reply to this message
Old 10-28-2013, 05:06 PM   #26
alien
Feedback Score: 1 reviews
Recipes 
 
Join Date: Apr 2012
Location: Philadelphia, PA
Posts: 1,234
Liked 65 Times on 58 Posts
Likes Given: 61

Default

I had a go at reworking the Arduino PID AutoTune Library over the weekend.

I think I have come up with a better way of detecting the response to the autotune signal, which may finish up faster and give slightly better tunings. I also implemented some new tuning rules which might work better than the default method under certain circumstance, as well as making some other changes under the hood.

alien is offline
tob77 Likes This 
Reply With Quote Quick reply to this message
Old 10-28-2013, 05:07 PM   #27
alien
Feedback Score: 1 reviews
Recipes 
 
Join Date: Apr 2012
Location: Philadelphia, PA
Posts: 1,234
Liked 65 Times on 58 Posts
Likes Given: 61

Default

duplicate post

__________________
Magic Smoke brewhouse and grill

Arduino PID controller - Automatic Smoker - Cooler MLT - Counterflow Chiller - SSR demo - PWM timer - Folding Brew Table
alien is offline
 
Reply With Quote Quick reply to this message
Old 10-28-2013, 11:39 PM   #28
tob77
Feedback Score: 0 reviews
Recipes 
 
Join Date: Sep 2012
Location: Napa, CA
Posts: 62
Liked 6 Times on 4 Posts
Likes Given: 19

Default

Quote:
Originally Posted by alien View Post
I had a go at reworking the Arduino PID AutoTune Library over the weekend.

I think I have come up with a better way of detecting the response to the autotune signal, which may finish up faster and give slightly better tunings. I also implemented some new tuning rules which might work better than the default method under certain circumstance, as well as making some other changes under the hood.
Thanks for sharing! I like the comprehensive set of tuning rules that you included. Do you have a favorite?
__________________
tob77 is offline
 
Reply With Quote Quick reply to this message
Old 10-29-2013, 07:33 PM   #29
alien
Feedback Score: 1 reviews
Recipes 
 
Join Date: Apr 2012
Location: Philadelphia, PA
Posts: 1,234
Liked 65 Times on 58 Posts
Likes Given: 61

Default

Thanks! I'm still testing them out at the moment.

Heating a big tank of water with an electric element should be a lag-dominant process, so in theory Tyreus-Luybin should do better than the default (Ziegler-Nichols).

Heating up and cooling down are asymmetric processes which seems to trick many PID controllers. (You really don't want to overshoot on a well insulated tank.) I am working on a fix for that, too.

__________________
Magic Smoke brewhouse and grill

Arduino PID controller - Automatic Smoker - Cooler MLT - Counterflow Chiller - SSR demo - PWM timer - Folding Brew Table
alien is offline
 
Reply With Quote Quick reply to this message
Old 11-03-2013, 04:34 PM   #30
alien
Feedback Score: 1 reviews
Recipes 
 
Join Date: Apr 2012
Location: Philadelphia, PA
Posts: 1,234
Liked 65 Times on 58 Posts
Likes Given: 61

Default

So, in my simulations the AMIGOf tuning rule came out best all round for PI controllers. It was slower to complete the auto tune than the other methods of this kind but never gave really bad tunings.

Also I have added a compile option to allow a biased relay, which can help find tunings for non-linear processes, or if there is a load disturbance (i.e. conditions change during the auto tune). I'm still debugging so there might be some fixes to come.

__________________
Magic Smoke brewhouse and grill

Arduino PID controller - Automatic Smoker - Cooler MLT - Counterflow Chiller - SSR demo - PWM timer - Folding Brew Table
alien is offline
 
Reply With Quote Quick reply to this message
Reply


Quick Reply
Message:
Options
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can it even be done? Measuring Specific Gravity using Arduino or Raspberry Pi remthewanderer Automated Brewing Forum 72 05-27-2014 05:22 PM
Raspberry Pi or Arduino (for layperson) jbaysurfer Automated Brewing Forum 10 07-15-2013 10:48 PM
Help me decide: Arduino or Raspberry Pi for brewing and smoking applications jfenton78 Automated Brewing Forum 20 04-11-2013 03:57 PM
New Open Source Arduino Based PID Controller Released bendiy DIY Projects 9 02-11-2013 08:33 AM
Priming Sugar Calculator (source code in C) mikegarri Brewing Software 1 07-22-2010 03:40 PM