Recirculation infusion mash system library for Arduino

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

franckgaga

Well-Known Member
Joined
Jun 9, 2013
Messages
53
Reaction score
8
Location
Quebec
It's my first thread on this forum so, hi everybody !

I'm now developing an Arduino library for RIMS control for a replacement of commercial PIDs. You can see my Google Code page here :

rims-arduino-library

Maybe you're asking yourself why reinventing the wheel, as in : commercial PID is cheap and simple. Here's some of my reasons :

  • Arduino + a LCD Keypad was cheaper for me
  • It's a lot more customizable (heater led indicator, flow sensor, countdown timer, etc.)
  • For the challenge

What is planned :

  • PID auto-tunes functions so it will be easier for non-expert.

Report bug and suggestions here.

Recirculation infusion mash system library for Arduino

This library implement RIMS controls for home brewers. For definition of a RIMS, see What is a RIMS?

For me, an Arduino micro controller + a LCD Keypad shield was cheaper and a lot more customizable than a commercial PID controller. So, with this library, a commercial PID controller is unnecessary.

BASIC FEATURES

  • User interface made with DFRobot LCD Keypad Shield for Arduino or similar (can be customized)
  • PID temperature regulation
  • SSR time proportioning control
  • thermistor reading with a voltage divider and Steinhart Hart coefficient
  • countdown timer
  • basic data logging through Serial communication (usb port)

ADDITIONAL FEATURES

  • PID derivative filter
  • PID set point filter for no temperature overshoot
  • Process identification tools
  • Possibility for 2 regulators useful for brewing simple\double batch size
  • heater led indicator
  • hall effect flow sensor
  • turn off heater if flow is critically low (< 0.5 L/min)
  • alarm with speaker when timer is elapsed or when flow\thermistor error


More info in docs

SCREENSHOTS

setPoint.JPG


Set point setup

timer.JPG


Timer setup

temp.JPG


Temp screen

timeFlow.JPG


Timer and flow screen

ident.JPG


Identification tools screen


DOWLOAD LINKS

Last version download link
 
dryboroughbrewing said:
sounds awesome, I use an Arduino to control my oddball RIMs system (heat tape RIMs) and I love it.

Ok, I'm curious. What is a "heat tape RIMs"?
 
Ok, I'm curious. What is a "heat tape RIMs"?

My RIMs tube consists of a few feet of stainless steel tubing (mcmaster-carr) wrapped in heat tape with compression fittings on either end. The end result is that I heat the tube from the outside rather than heating a piece of pipe from the inside like in a traditional RIMs tube.
 
Ok, I'm curious. What is a "heat tape RIMs"?

Heat tape is basically a flexible resistive heating element that you can tape to an object to heat it... I'd assume he's got it wrapped around his RIMS tube rather than having a heating element inclosed. This probably works well if the MT is well insulated.

As for your library, I like it, looks like you have effectively rolled up all the PID stuff and a nifty UI so that the user can save a bunch of lines of code in the main sketch. I'll be sure to test this out when I finish out my control panel.
 
Thanks everyone !

Added : possibility for an alarm with a buzzer when the countdown timer elapsed
 
I've finished the main functions of the library and tested it most of it...it works flawlessly

Add documentation at this link
 
This may be an ignorant question, so I apologize in advance, but does this work in Arduino 1.0.5??

When trying the example "rimsBasic" with an UNO and a LCD Shield on the correct pins I get the errors

"In file included from rimsBasic.ino:3:
C:\Program Files (x86)\Arduino\libraries\RIMS/Rims.h:10: error: expected unqualified-id before '/' token
C:\Program Files (x86)\Arduino\libraries\RIMS/Rims.h:10: error: expected constructor, destructor, or type conversion before '/' token"

when trying to compile.

I downloaded the latest library, created a folder names RIMS in my library folder, and extracted your library files into it.
 
This may be an ignorant question, so I apologize in advance, but does this work in Arduino 1.0.5??

When trying the example "rimsBasic" with an UNO and a LCD Shield on the correct pins I get the errors

"In file included from rimsBasic.ino:3:
C:\Program Files (x86)\Arduino\libraries\RIMS/Rims.h:10: error: expected unqualified-id before '/' token
C:\Program Files (x86)\Arduino\libraries\RIMS/Rims.h:10: error: expected constructor, destructor, or type conversion before '/' token"

when trying to compile.

I downloaded the latest library, created a folder names RIMS in my library folder, and extracted your library files into it.

Oops, sorry i've made a little typo and didn't re-test it.

It's corrected now
 
Much better - Thank You.

I noticed that the display is dim, I'm guessing because of the constant updating? I need to read through all of your documentation, thank you for your efforts! :)

EDIT - Readjusted the display contrast and now all is well
 
More questions - for the function setThermistor - Your looking for an array of 4 variables for the steinhartCoefs. I guess these are for the values of A, B, & C? Is there a D??
 
-bugfixe : identRimsBasic was not compiling because of a change made in UIRims constructor

Please re-downlaod
 
More questions - for the function setThermistor - Your looking for an array of 4 variables for the steinhartCoefs. I guess these are for the values of A, B, & C? Is there a D??

I've classified my coefficients by power order, i.e. :

Code:
|| C0 || C1 || C2 || C3 ||

But, in fact, if we follow Wikipedia and many datasheets, equation is :

0b5595b8d14e9aeb0e2f3c765d59138c.png


So, with this definition above, array format would be :

Code:
|| A || B || D || C ||

In datasheets, D is often omitted because of is low influence in the results. You can just write "0" for D coefficient.

Cheers !
 
What is meant by a simple or double batch? My batch size is a fairly consistent 11 gallons.

It's because for me...I've got a big cooler for my MLT...If i'm brewing alone, I just brew a 6 gal but if i'm brewing with my friends i'll brew a 11 gal that still fit in it.

If you are always brewing the same quantity, this features is useless...just ignore it, i.e. call setTuningPID and/or setSetPointFilter as before.
 
setInterruptFlow ( byte interruptFlow, float flowFactor ) - I understand the flow factor - but interruptFlow is the whole number (0-255) measurement of flow if when reached, shuts off the heaters?

Ordered 10K Thermistors and a 0-30 l/min flowmeter from Ebay - looks like I'll do some testing for you when they get her.
 
setInterruptFlow ( byte interruptFlow, float flowFactor ) - I understand the flow factor - but interruptFlow is the whole number measurement of flow if when reached, shuts off the heaters?

That's great, your question point me sections in the docs that was very unclear/undocumented, thanks haha !

Firstly, interruptFlow is the Arduino interrupt number (equivalent to pin number) that the sensor is connected. For more information : http://arduino.cc/en/Reference/attachInterrupt
For ex, if sensor is connected to pin 3, interruptFlow = 1

Secondly, i did not implement functions to shut off heater when flow measurement is incorrect...It is displayed on the screen if it is ok or not (between 2 to 4 L/min i think) and if a speaker is added, it will ring if it is incorrect...I did not want to block the whole process. I'm a bit hesitant on that...maybe it would be safer...I don't know what's your opinion on that ?
 
Allthough I've never had a stuck flow on mine, having the option to shut down the heat if the flow stops would be nice. But - It doesnt have to be coded in the library. If there was a function called heatEnable(binary enable) to turn the element off. It appears that we can read the flow and do math or make decisions on it in loop().
 
Getting errors

identRimsBasic:7: error: no matching function for call to 'UIRimsIdent::UIRimsIdent(LiquidCrystal&, int, int, int, int)'
C:\Program Files (x86)\Arduino\libraries\RIMS/utility/UIRimsIdent.h:22: note: candidates are: UIRimsIdent::UIRimsIdent(LiquidCrystal*, byte, byte, int)
C:\Program Files (x86)\Arduino\libraries\RIMS/utility/UIRimsIdent.h:17: note: UIRimsIdent::UIRimsIdent(const UIRimsIdent&)

When trying to compile identRimsBasic
 
Getting errors

identRimsBasic:7: error: no matching function for call to 'UIRimsIdent::UIRimsIdent(LiquidCrystal&, int, int, int, int)'
C:\Program Files (x86)\Arduino\libraries\RIMS/utility/UIRimsIdent.h:22: note: candidates are: UIRimsIdent::UIRimsIdent(LiquidCrystal*, byte, byte, int)
C:\Program Files (x86)\Arduino\libraries\RIMS/utility/UIRimsIdent.h:17: note: UIRimsIdent::UIRimsIdent(const UIRimsIdent&)

When trying to compile identRimsBasic

That's strange I don't have this bug with the latest version (v0.7)

Did you update all the library's file ? This bug was supposed to be corrected in v0.6.2...
 
Allthough I've never had a stuck flow on mine, having the option to shut down the heat if the flow stops would be nice. But - It doesnt have to be coded in the library. If there was a function called heatEnable(binary enable) to turn the element off. It appears that we can read the flow and do math or make decisions on it in loop().

That's a good point... i'll add this feature soon : maybe something like :

  • alarm and LCD indicator if flow < 2 and > 4 L\min
  • shut off heater if flow < 0.5 L/min
 
I made my first identification test and found that identification is wayyyy easier with a fixed sample time (i.e 0.1 sec would do the job I think)

I'll modif that soon in IdentRims...

BTW, my RIMS system (and I would say most of them because of the weird thermal behavior of an heating element with pumped liquid on it) is in the form (Laplace) :

Kp * (1 + Tz*s)
-----------------
s * (T1*s + 1)

I.E. :

  • A gain
  • A zero
  • An integrator
  • A pole
  • Maybe a delay but it was not present for me
 
New version (v0.8) available : download here

Fixed :

-fixed sample time in identification
-identification procedure was too short : now 30 minutes
-LCD refresh time now 1000 mSec (500 mSec was too short for my LCD)
-better timing in Rims to assure constant PID sample time calculation
-RimsIdent uses parent class run() method

Added :

- basic data logging through Serial communication (usb port)
- turn off heater if flow is critically low (< 0.5 L/min)
 
New version (v0.8) available : download here

Fixed :

-fixed sample time in identification
-identification procedure was too short : now 30 minutes
-LCD refresh time now 1000 mSec (500 mSec was too short for my LCD)
-better timing in Rims to assure constant PID sample time calculation
-RimsIdent uses parent class run() method

Added :

- basic data logging through Serial communication (usb port)
- turn off heater if flow is critically low (< 0.5 L/min)

Found some bugs with Rims class and Timing...i'll post an update soon
 
rimsBasic.ino: In function 'void setup()':
rimsBasic:13: error: 'class Rims' has no member named 'setTunningPID'
 
rimsBasic.ino: In function 'void setup()':
rimsBasic:13: error: 'class Rims' has no member named 'setTunningPID'

If you download last version, you shouldn't have this bug in rimsBasic exemple. If it's your own *.ino file, i've made a few changes in methods :

- setTunningPID() replaced by setTuningPID in Rims
- run() replaced by startIdent() in RimsIdent
- optional arguments stopOnCriticalFlow=true added in method setInterruptFlow
- optional arguments batchSize=SIMPLEBATCH added in setTuningPID() and setSetPointFilter()

Cheers !
 
Clean copy of rimsBasic and using 0.84 library, still getting error

rimsBasic.ino: In function 'void setup()':
rimsBasic:13: error: 'class Rims' has no member named 'setTunningPID'

on Arduino 1.0.5
 
Clean copy of rimsBasic and using 0.84 library, still getting error

rimsBasic.ino: In function 'void setup()':
rimsBasic:13: error: 'class Rims' has no member named 'setTunningPID'

on Arduino 1.0.5

Yep, you're right, sorry ! I don't know why it is still there but anyway...

New version available (v0.8.5) :

bugfixes :

- rimsBasic.ino now compile
- IdentRims flow warning LCD refresh rate = IDENTSAMPLETIME
 
I have made a lot of test with my RIMS in the last days. The next release is no longer beta.

Hence, new version available v1.0 :

debug :

- _refreshDisplay() when switch screen
- temp ADC >= 1021 is considered like unconnected thermistor
 
Back
Top