Arduino Development Thread

Australia & New Zealand Homebrewing Forum

Help Support Australia & New Zealand Homebrewing Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
When I was testing with my electric jug, the best I could do was:

Kp=5, Ki=0.5, Kd=98. I also clamped the Ki to never go over 5 to prevent wind up.

With those values, I was getting around a 0.7°C overshoot, which isn't bad considering it is a 2.4KW element in a 1.7L vessel.
 
I have spent a lot of time playing with the pid library but I just went with the original one and turned it on 5 degs to go which reduces the amount of Ki wind-up but if you look at the PID beta 6 library http://code.google.com/p/arduino-dac/source/browse/DecaTest_v2/ArduinoCode/libs/PID_Beta6/?r=23 it does not intergrate unless the output is below maximum output which limits it from winding up. I have played with clamping Ki, which works well but can cause overshoot or undershoot depending on how much you clamp it to. I also have changed the standard library so that when kp is above max out Ki is 0 and if kP is negative then Ki is 0, that work OK but could be a bit notchy.

Iterm clamp library http://www.mediafire.com/?oo9e5b0t7g1l08w

Iterm clamp + no intergration when limits are exceeded http://www.mediafire.com/?4do6ld357286azp

Iterm clamp + Iterm set to 0 if outputs are exceeded http://www.mediafire.com/?4do6ld357286azp

the last one was made up for step mashing.

The PID figures in the brauduino code was a bit of a guess as don't know what system the unit is going to be used on.

Heating water takes a very long time so increase you sample time to reduce the number of times that Ki intergrates also if you make it long enough you will eliminate the problem you mentioned with the KD.

I'll upload a spreadsheet that I used to get my head around all this pid stuff

cheers steve
 
I haven't tried or even looked at the autotune so I don't know about it but the PID beta 6 library looks like a better library to me, the brewtroller uses it for its PID. here http://www.mediafire.com/view/?9ewpb6mib64nbvk is the spreadsheet that I put together to have a play with pids, its not very flash and it would take too long to explain how it works but have a play and a look and you should be able to work it out. I converted it from .ods to .xml so it might not work as well.

cheers steve
 
I skipped the autotune, but I do use the v102 library with the clamp, works a treat for me.
 
vortex said:
Picked up a couple of I2C relay boards:
[ ... ]
Small one has 8 relays, 10a@250v, I2C connection.
[ ... ]

Big one has 8 relays, 30a @250v. I2C connection also. Likely to need a bloody big heatsink :)

Got them from http://www.ereshop.com/shop/i2cbus-boards-c-143.html ordered last thursday, arrived today. Not the cheapest boards around but should do the job! Documentation is a little thin on the ground, though :( Ti chip, so hoping it's common enough that there is plenty of doco around for it.
These look nice, and I guess an 8-port board would mostly do a whole brewery.

I've been playing with these: http://arduino-direct.com/sunshop/index.php?l=product_detail&p=218
They're not I2C, but $3.95 is about my price point ;)

Once I finalise my design, I plan on buying a few of these, and when the mechanics wear out, just dropping in a new one.
They also have 4-port and 8-port relay boards.

cheers,
-kt
 
For the Arduino aficionados out there, I'm looking to try and build an automated brewery that will control:

2x 2400w elements in one vessel, a ~1000w element in another, a march pump, a klaixon pump, a brown pump, three temp probes, 12v atv winch, one or two 12v motors, probably two float switches.

Can I run all these things from one controller? If not can one controller be triggered from another? E.g- once mashout is completed can the main vessel controller trigger another to engage, with the other controller operating the winch, heating of sparge water, and pumping of the heated sparge water?

If it's not possible I will look to just make two controllers, and after a few runs overseeing the brewday manually, should have the temp ramp timing sussed enough to set both controllers independently but working together (if that makes sense).

Any insight/advice would be much welcomed as I have essentially zero knowledge on all things Arduino.


Cheers
 
So, two elements, means two relays from one output, another element relay from another output, three relays for three pumps (one is 12v but controlling is no different) a relay for the winch, relays for another two more 12v motors.

Two float switches on inputs. What about temp sensors for mash temps?

Anyway, I count at least 10 relays. That's a lot of relays.

You can buy I2C relay boards which have 8 relays, i have some of those, so in theory you can control enough relays.
Temp sensors the DS18B20 OneWire's are OK, they work with Arduino OK too.
Inputs for float switches should then have ample space available.

Programming logic should fit on the ROM of an Uno, so that might work OK but if the budget isn't too tight, have a look at the Arduino Mega, which has a lot more ROM space for sketches.

Or do what I did and use something like a BeagleBone/RaspberryPi, which are embedded linux platforms, way more powerful and way more flexible.
 
Cheers for the reply Vortex,

I'll look into the l2c relay board you mentioned, sounds like that might be the go.

I already have the DS18B20 sensors but they have three wires from memory.
The plan was to use two of them in the main vessel for the mashing (was thinking if possible to use the average temp between the two sensors-not sure if that's even possible and may be over complicating things) and use the other sensor in the sparge water vessel.

Float switches aren't a necessity-more just a piece of mind thing to ensure I've always got wort above the elements.

Definitely have some more reading/research to do! :icon_cheers:
 
Judanero said:
I already have the DS18B20 sensors but they have three wires from memory.
Yes they have 3 wires, they run on a one wire bus (one wire for data) and can be daisy chained, I'm sure one of the guru's will chime in and explain it better.
 
MastersBrewery said:
Yes they have 3 wires, they run on a one wire bus (one wire for data) and can be daisy chained, I'm sure one of the guru's will chime in and explain it better.
You can't explain it much better than that. Each sensor has its own address, and I think 7 can be run on the same bus (data wire).

I've just received the parts for more bonjuinos if that interests you. They require assembly and a separate programming cable (USB to serial cable with FTDI FT232RL chip) / breakout board (FT232RL basic breakout (usually a bit cheaper than the cable (around $12))), but are a bit more flexible than a standard arduino. You can see the differences here: http://www.bigfathooker.com/bfh/bonjuino.php

Arduino's can be configured to talk to each other either by I2C or serial, but as vortex said, with that many I/Os and associated code, you may want to think about an Arduino Mega.
 
vortex said:
I picked up two boards from here, 10amp x 8 for fermentation controller, and 30amp x 8 for the brewery.
http://www.ereshop.com/shop/i2cbus-boards-c-143.html
If your using relays to control Heating elements with PID you will need SSR's (solid state relay) due to high frequency of switching, those little ones will burn out. These would need one digial pin for each device (eg Kettle or HLT).
 
MastersBrewery said:
If your using relays to control Heating elements with PID you will need SSR's (solid state relay) due to high frequency of switching, those little ones will burn out. These would need one digial pin for each device (eg Kettle or HLT).
Not what I've been told. I was told they could have shorter service life, I can live with that, but I'm implementing the PID algorithm in software which I'm writing so I will have my own protections built in also.
 
vortex said:
Not what I've been told. I was told they could have shorter service life, I can live with that, but I'm implementing the PID algorithm in software which I'm writing so I will have my own protections built in also.
problem being if it goes pear shape they are know to fail in the closed position when over heated, so software won't turn it off. though as a fail safe you could use a second relay the remains closed constantly whilst device is in use.
 
Yep, the plan is to switch active and neutral, as I have more relays than I need anyway. To hopefully prevent those issues, but also for safety.
 
I would still recommend against mechanical relays for pid because of the electrical noise and associated glitches you will face. That is a lot of EMI and a Shitload of clicking noise!

Also if you are using 3x PID then you will use a lot more code space than the rest of us who use only one. I would go with the previous version of the mega, which you can source really cheaply these days. DX.com
 
Edak said:
I would still recommend against mechanical relays for pid because of the electrical noise and associated glitches you will face. That is a lot of EMI and a Shitload of clicking noise!

Also if you are using 3x PID then you will use a lot more code space than the rest of us who use only one. I would go with the previous version of the mega, which you can source really cheaply these days. DX.com
Thanks. My brewery will be using a BeagleBone so code size isn't an issue.
 
yes, but the clicking would drive you insane!

I have an expensive data logger which uses physical relays for all analog channels (to provide full channel-channel isolation), the clicking drives me crazy so I use digital sensors only.
 

Latest posts

Back
Top