Ss Brewing Technologies Giveaway!

Home Brew Forums > Home Brewing Beer > Automated Brewing Forum > Help me decide: Arduino or Raspberry Pi for brewing and smoking applications
Reply
 
LinkBack Thread Tools
Old 04-05-2013, 12:46 PM   #11
kwadric
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jun 2012
Location: Richmond, Virginia
Posts: 139
Liked 11 Times on 8 Posts

Default

There is an easy to use PID library for the Arduino. I use an older version that I modified to reduce the affects of integer wind up, but new versions have autotune algorithms.

A quick Google showed a several of RPI PID projects for brewing. I haven't b researched it much because I'm comfortable with my Arduino code and I've been using it for three years with out many issues.

__________________
kwadric is offline
 
Reply With Quote Quick reply to this message
Old 04-05-2013, 01:09 PM   #12
tphjr
Registered User
Feedback Score: 0 reviews
Recipes 
 
Join Date: Mar 2013
Posts: 69
Liked 4 Times on 4 Posts

Default

Quote:
Originally Posted by kwadric View Post
There is an easy to use PID library for the Arduino. I use an older version that I modified to reduce the affects of integer wind up, but new versions have autotune algorithms.

A quick Google showed a several of RPI PID projects for brewing. I haven't b researched it much because I'm comfortable with my Arduino code and I've been using it for three years with out many issues.
Can you share the new version with the autotune algorithm?
__________________
tphjr is offline
 
Reply With Quote Quick reply to this message
Old 04-05-2013, 01:30 PM   #13
CapnBry
Feedback Score: 0 reviews
Recipes 
 
Join Date: Oct 2012
Location: Tampa, Florida
Posts: 38
Liked 5 Times on 4 Posts
Likes Given: 1

Default

I've been working on a project that has a web interface to a controller algorithm for the past 4 years now, starting with just Arduino w/ SPI wifi and a 2MB flash addition, then moving through various platforms as they became available.

ATmega (Arduino): Real time operation, ADCs, digital I/O and flexible PWM. Great for sensors and control, but the lack of RAM/storage really kills you when you want to make a web interface that is any more than just some basic text dump. I stored a web page in dataflash then had the page call back and request the actual data in JSON which was built in code. This worked ok but you've only got 1 simultaneous connection so it is pretty slow, and there's no history.

rPi - Freakin' awesome CPU power, RAM, storage. It isn't "real time" but it is close enough for most applications. If you don't need ADC or things like timer input capture or analog comparators, this is all you need.

I went with a hybrid approach, needing an ADC I figured the cost on an ATmega was comparable to a single ADC chip and I'd just let it do all the control and let the Pi do all the web serving and data storage. The microcontroller talks to the Pi via serial to a service, and the web service talks to that through a UNIX domain socket. The ATmega is also attached to the SPI bus so it can be flashed with new firmware via the web interface. It is like the best of both worlds, and gives you the safety of knowing that if the Pi crashes, the microcontroller still does its job.

The RaspberryPi with a wifi adapter is also fantastic because you don't have to run an ethernet cable to the controller. A lot of projects look like a giant CF of wires and crap so cutting at least this cord was a goal of my project.



HeaterMeter Project on GitHub

__________________
CapnBry is offline
 
Reply With Quote Quick reply to this message
Old 04-05-2013, 02:04 PM   #14
kwadric
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jun 2012
Location: Richmond, Virginia
Posts: 139
Liked 11 Times on 8 Posts

Default

Here is a link to the PID library on the official library. The cod was developed by Brett Beaureguard and I believe he lurks around this forum... or at least used to.

The first link has some info about PID. The Wikipedia page was also helpful for me. I am an electrical engineer, but did no controls work in college.

http://playground.arduino.cc/Code/PIDLibrary

This is the autotune link:
http://playground.arduino.cc//Code/PIDAutotuneLibrary

__________________
kwadric is offline
 
Reply With Quote Quick reply to this message
Old 04-05-2013, 02:16 PM   #15
kwadric
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jun 2012
Location: Richmond, Virginia
Posts: 139
Liked 11 Times on 8 Posts

Default

CapnBry, your sept up is similar to what I have for my Ferm Controller. I run the PID on the Arduino and dump the data to the serial buss as text. I use a Python script on the RPI to read the serial data and store it to a MySQL database. I run Apache with php on the RPI. Then I use php to query the MySQL and display data. I also use php to update the table for the fermentation chamber settings.

For brewing, I use the Arduino on the PID and dump data to the serial bus. I use a .Net program on my laptop to read the data and change the set points.

__________________
kwadric is offline
 
Reply With Quote Quick reply to this message
Old 04-05-2013, 04:13 PM   #16
tphjr
Registered User
Feedback Score: 0 reviews
Recipes 
 
Join Date: Mar 2013
Posts: 69
Liked 4 Times on 4 Posts

Default

Quote:
Originally Posted by kwadric View Post
Here is a link to the PID library on the official library. The cod was developed by Brett Beaureguard and I believe he lurks around this forum... or at least used to.

The first link has some info about PID. The Wikipedia page was also helpful for me. I am an electrical engineer, but did no controls work in college.

http://playground.arduino.cc/Code/PIDLibrary

This is the autotune link:
http://playground.arduino.cc//Code/PIDAutotuneLibrary
Thanks, I took a look at the autotune link and it might work for me.
__________________
tphjr is offline
 
Reply With Quote Quick reply to this message
Old 04-05-2013, 04:37 PM   #17
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

By the way, those Arduino libraries are what runs on osPID.

For experimental purposes I ported them to C, which might be useful if anyone is interested in getting away from the Arduino IDE.

The BrewTroller firmware, at least in its earlier versions, used an earlier version of the same Arduino PID library.

The author Brett occasionally pops up on this forum with useful info.

alien is offline
 
Reply With Quote Quick reply to this message
Old 04-10-2013, 04:50 PM   #18
cadwallion
HBT_SUPPORTER.png
Feedback Score: 0 reviews
Recipes 
 
Join Date: Mar 2012
Location: Sycamore, IL
Posts: 157
Liked 35 Times on 26 Posts

Default

I am currently using a Raspberry Pi with an expansion board to wire up my DS18B20's for inputs and SSRs for outputs. The lack of realtime has not bothered me because I wrote my PID algorithm library to account for timeshifts. What I intend to experiment with more is using an Arduino (well, an Atmel microcontroller running on my own board) running mruby with a RasPi running mruby and interfacing via I2C. So far it's looking promising.

__________________
cadwallion is offline
 
Reply With Quote Quick reply to this message
Old 04-10-2013, 08:26 PM   #19
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

It would be good to retool the PID library using a real time OS.

For practical purposes you can usually forget about the D parameter anyway, so I'm not sure how much difference it would make.

__________________
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 04-11-2013, 02:33 PM   #20
CapnBry
Feedback Score: 0 reviews
Recipes 
 
Join Date: Oct 2012
Location: Tampa, Florida
Posts: 38
Liked 5 Times on 4 Posts
Likes Given: 1

Default

Quote:
Originally Posted by alien View Post
It would be good to retool the PID library using a real time OS.

For practical purposes you can usually forget about the D parameter anyway, so I'm not sure how much difference it would make.
PIDLibrary is already written for a real-time OS. How much more real-time do you get than a microcontroller? And using them from user-space Linux is fine too. Why would you need less than 10 milliseconds of response time to react to something that changes so slowly, such as 15 gallons of water connected to a temperature sensor that takes 750ms to take a 12 bit reading?

For practical purposes in this application you most certainly can not forget about the D parameter. In systems where the "impulse time" is so large (the amount of time between you changing your output to the time where the input value actually changes), the D parameter is especially important to anticipate massive overshoots and oscillations.
__________________
CapnBry 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
Automated Electric Arduino Based Brewing System stockmaster Automated Brewing Forum 1 09-12-2012 12:11 AM
Automated Electric Arduino Based Brewing System stockmaster Automated Brewing Forum 7 08-18-2012 02:59 AM
Brewing and smoking... Brewcrew86 Meat Smoking, Curing and Sausage Making 6 03-17-2012 03:32 AM
For Sale - Palm III with brewing applications - $10 aekdbbop For Sale 2 07-16-2009 04:24 PM