CraftBeerPi - Raspberry Pi Software

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.
What would I set the logic to to set the element manually?

Should I re run pid auto tune?
I think it's PWMSimple or something like that.
I tried a different boil logic the last time I brewed and was really happy with it. IllIfire up my controller and let you know what I used.

I've also noticed that every time iveI run PID Auto tune I've come up with pretty different results.
 
So I was doing some more reading, and it looks like PWM logic is probably best for my boil. A lot of people recommended SimpleBoilLogic plugin.

One thing I noticed though is that on the website, it says that using a relay boards means that you can't used PID logic.. and I use a relay board to control my two SSRs for the heating element. Does this mean that I can't use PIDBoil at all for my mash? What should I use instead?
 
@tzacher Not entirely accurate statement. Don't use PWM with a relay board. It's possible to use PID without using PWM necessarily (not common on "hot side", but brewpi logic is a common example of this...).

That being said, why are you using a relay board to control SSRs? At most you should use a transistor to amplify the RPi GPIO, but oftentimes SSRs can be controlled directly from RPi pins.
 
@jangevaa honestly just doing what my friend that had already built a CBPi with a similar setup told me to do. It's a 2 channel relay board that I use to control the 2 SSRs for my element. One pin from the pi controls it on and off. Can I use two pins to control the same heater to go on and off?

Sorry for the ignorance, I really know very little about electronics/raspberry pi
 
@tzacher It's cool.

Do you use 2 SSRs for one element?

Try connecting the SSRs directly to your pi (assuming the control signal for them is 3-32VDC, they will probably work fine).

Those relay modules are often used to control things like pumps, lights, etc. Not useless by a long shot, but shouldn't be used for your element control circuit for sure.
 
@jangevaa I do. It's a 5500W element and the plug it's coming from is a 4 pronged dryer cord, so one hot line goes to each SSR, I believe. Then those run to a 3-prong plug.
 
@jangevaa I do. It's a 5500W element and the plug it's coming from is a 4 pronged dryer cord, so one hot line goes to each SSR, I believe. Then those run to a 3-prong plug.
Gotcha. Not typical, doesn't provide any real benefit or additional safety to have 2 SSRs here. Should always disconnect element when not monitored physically - either appropriate DPST or DPDT contactor or simply unplug it (that's what I do).

But anyways, I would just connect the SSRs directly to the pi as I mentioned in the other post, and use PWM after that is done.
 
Is there a better way to wire? I think I saw a wiring diagram that had the second hot wire going directly to the element. Would that work? Wouldn't that constantly run to the element, thus heating it when you don't want it to?
 
Is there a better way to wire? I think I saw a wiring diagram that had the second hot wire going directly to the element. Would that work? Wouldn't that constantly run to the element, thus heating it when you don't want it to?
I have a hybrid set up similar to what you describe here. The ssr interrupts only one hot leg of the 240v element but I also wired in series a double pole contactor. I use a 2 position switch for power to the coil to give me a manual override to shut all power to the element off whenever I want. When the switch is in the on position, one hot leg is going to the element. I haven't noticed this provide any meaningful heating.

Edit: grammar
 
@tzacher, no heating/movement of electricity will occur unless the circuit is closed.

This is a slight simplification is there is a very small leakage current from SSR, but effectively the circuit is open and nothing will happen.

For safety reasons you should unplug the element or use an appropriately rated DPDT or DPST contactor to ensure physical disconnection of circuit, when it is not in use.

If you wanted a contactor with e-stop in your panel, it would be sufficient to have a single contactor for the entire panel rather than having one for each element in the event you had several.

*all components must be properly rated to their intended usage. A reduction in component rating should be protected by an appropriately sized fuse or circuit breaker.
 
Each pin have this circuit:

554933


You can measure voltage on the base of BC337 against ground, it should swing from 0 when gpio off to 0,7 when on. if order to see voltage swing in the output you need a load connected, a 1K resistor will do. May be the transistor is broken. The diode is there to prevent hi voltages when switching coil relays, it can be removed for ssr. watch out also for solder bridges .
Question about this circuit....
I am going to use a Pi Zero W for a fermenter controller. I don't have a Terragady board for it, but want to bump up the 3.3v output from the Pi GPIO output to 5 or 12v for running a relay and SSR.
Can I just copy this circuit on a perfboard and get the same effect as the Terragady board?

I'm a bit confused on actual connections though. That top line with 5V and 12V connected together is confusing. Plus, where would I connect the SSR and relay?

But, I may need a diode, as explained at THIS WEB PAGE.

Here is a picture of my relay, with +, - and S pins.
IMG_20190430_205650634.jpg

Here's the SSR I'll be using.
https://i.ebayimg.com/images/g/uA8AAOSwFbpaqjgR/s-l1600.jpg
 
Last edited:
Question about this circuit....
I am going to use a Pi Zero W for a fermenter controller. I don't have a Terragady board for it, but want to bump up the 3.3v output from the Pi GPIO output to 5 or 12v for running a relay and SSR.
Can I just copy this circuit on a perfboard and get the same effect as the Terragady board?

I'm a bit confused on actual connections though. That top line with 5V and 12V connected together is confusing. Plus, where would I connect the SSR and relay?

But, I may need a diode, as explained at THIS WEB PAGE.

Here is a picture of my relay, with +, - and S pins.
View attachment 624829

Here's the SSR I'll be using.
https://i.ebayimg.com/images/g/uA8AAOSwFbpaqjgR/s-l1600.jpg
Yes that image ir wrong in the top line.
Just the relay an diode goes to 12v.
And for an ssr you can spare the diode also. Just put the resistor and the transistor.
If you gone use several outputs is easier to use a ULN2003 or ULN2803. These are 7 or 8 transistors with the cirresponding R in each base. Don't forget the diode to 12v if you use a mechanical relay, to prevent current spikes that will kill the transistor.
 
Thanks for the input. That really helps me know I'm not crazy looking at the previous schematic. Both your solutions are clear and make sense to me.

Maybe THIS would also work? Plus, get a free stepper motor out of the deal, for some future project. $4 with free shipping.

s-l1600.jpg
 
Alright, so I tried a slight rewire of my setup. Ran one hot leg to the SSR which is pinned directly to the Pi (GPIO 18). Ran the other hot leg directly to the socket for my heating element.

I tried re-running PIDAutotune using both GPIOPWM and GPIOSimple as the type for the actor. Both times it overshot my target temperature and refused to shut off. I checked the light on the SSR and it was off, but continuing to heat anyways. Anyone have advice?
 
Alright, so I tried a slight rewire of my setup. Ran one hot leg to the SSR which is pinned directly to the Pi (GPIO 18). Ran the other hot leg directly to the socket for my heating element.

I tried re-running PIDAutotune using both GPIOPWM and GPIOSimple as the type for the actor. Both times it overshot my target temperature and refused to shut off. I checked the light on the SSR and it was off, but continuing to heat anyways. Anyone have advice?

I had a similar problem when first using my system.
On occasion my SSR would "latch" and stay on. Usually after being 100% on for a while, like when bringing mash up to temp.
I found if I killed power to the SSR for a few minutes after I noticed it had 'latched" on sometimes it would go back to working off duty cycle and would be fine for the rest of the mash.
Researching I found most SSR's on the internet are fake, I think mine was a fake Futek.
I purchased some used 40 amp Crydom SSR's on ebay and haven't had a problem since.
When you said the LED light was off on the SSR to me that sounds like the Pi is doing its job.

Cheers!
 
Hi guys. So I´m new to the raspberry but I was in the mood for building a craftbeerpi system. I just have a couple questions before beginning.

Can it handle multiple systems at once? For example 2 different mashing tuns?
I was going to buy a bundle from aliexpress, should i get one with a LCD screen? or the 3.5inch screen is too small for anything?

Right now I´m brewing with a brewmaniacEX system which works great, I´ve even translated it and adapted it to use a gas burner.

But I´m curious to try the raspberry.
 
3.5"is way to small. 10"is bare minimum for something useful.
You can control temp for as many vessels as you want, but only have one steps execution thread.
 
3.5"is way to small. 10"is bare minimum for something useful.
You can control temp for as many vessels as you want, but only have one steps execution thread.

Ok thanks! That´s what I wanted to know, about the ongoing simultaneous processes. It would be nice that it could control multiple processes simultaneously.
I´ll also get a bundle that doesn't contain a LCD screen.
 
Hi guys. So I´m new to the raspberry but I was in the mood for building a craftbeerpi system. I just have a couple questions before beginning.

Can it handle multiple systems at once? For example 2 different mashing tuns?
I was going to buy a bundle from aliexpress, should i get one with a LCD screen? or the 3.5inch screen is too small for anything?

Right now I´m brewing with a brewmaniacEX system which works great, I´ve even translated it and adapted it to use a gas burner.

But I´m curious to try the raspberry.
Keep in mind that craftbeer pi has a web server, so you can log in on yur home network with a phone, tablet or PC and control the process. That is how I us mine.
 
Keep in mind that craftbeer pi has a web server, so you can log in on yur home network with a phone, tablet or PC and control the process. That is how I us mine.

Brewmaniacex has something like that too. While connected to my WiFi networks i can access the controller and watch the process. Turn on or off the pump, etc. After each successful brew has finished you can retrieve the logged data and graphics.

I ussually do that and paste it into an excel so i can keep track of what happened in each brew.
 
I had a similar problem when first using my system.
On occasion my SSR would "latch" and stay on. Usually after being 100% on for a while, like when bringing mash up to temp.
I found if I killed power to the SSR for a few minutes after I noticed it had 'latched" on sometimes it would go back to working off duty cycle and would be fine for the rest of the mash.
Researching I found most SSR's on the internet are fake, I think mine was a fake Futek.
I purchased some used 40 amp Crydom SSR's on ebay and haven't had a problem since.
When you said the LED light was off on the SSR to me that sounds like the Pi is doing its job.

Cheers!
I went out and bought a Crydom SSR that I thought was correct but now I'm not sure.. The input is 3-32V DC but I believe the output is 40A 100V VDC.. Do I need a VAC SSR for this to work properly?
 
I went out and bought a Crydom SSR that I thought was correct but now I'm not sure.. The input is 3-32V DC but I believe the output is 40A 100V VDC.. Do I need a VAC SSR for this to work properly?
If you want to control something that runs on AC power - which is usually the case - yes.
 
I found the Glycol Chiller addon in the list, but can't figure out how to use it. Is it even necessary? Does it work?
If I just use 2 fermenters in the GUI, won't that do what I need? ie. Control the temp of the glycol temp in the tank (cooler), and control the pump to cool the chiller coil in the fermenter?

Has anyone used the Glycol Chiller addon and can give some hints?

Or, I suspect it's not actually a usable add-on.
 
I configured the Gycol Chiller as one more fermenter set to -5 C .
The other Frementers control each individual solenoid valve and a Group Actuator join them to control the pump.
 
Alright, new Crydom SSR is here. But I can't get PID Autotune to work! Everything I've tried so far and it just keeps failing. Any thoughts on what to change to help??
 
Alright, new Crydom SSR is here. But I can't get PID Autotune to work! Everything I've tried so far and it just keeps failing. Any thoughts on what to change to help??
You really need to get in the habit of telling us what is happening specifically, and including logs if you are able. Otherwise "can't get it to work" could mean anything.

This is a good read for that.
 
Basically, I've run autotune with a couple of different settings now and it keeps failing at the end. I've done GPIO Simple & GPIO PWM, changed the lookback settings, etc. I have no problem getting to mash temp but from there it looks like it overshoots the temp by 1 or 2 degrees and holds that pretty constantly instead of the desired temperature. It'll run for about an hour or so and then eventually just fails. I've attached a log from one of my latest runs
 

Attachments

  • log.txt
    3.2 KB · Views: 20
Basically, I've run autotune with a couple of different settings now and it keeps failing at the end. I've done GPIO Simple & GPIO PWM, changed the lookback settings, etc. I have no problem getting to mash temp but from there it looks like it overshoots the temp by 1 or 2 degrees and holds that pretty constantly instead of the desired temperature. It'll run for about an hour or so and then eventually just fails. I've attached a log from one of my latest runs
With the caveat that I don't run craftbeerpi - but I do understand PID loops, what it looks like is something is "oversized." What that "something" is depends on the setup. It could be the Kp is too large, the Kd not large enough, the heat source too strong, or the controlled mass too small. (Probably another 10 things it could be).

I read your other posts and it seems you're using a 5500W heater for this and I assume doing a mash given the temps. You have about 1 degree/min heating shown there so I'm gonna go out on a limb and say this is a very small mash size. Maybe 5 gallons of water and no grain to test? It looks like a 13% duty cycle if I'm right so far.

I'm not trying to solve your problem here, just trying to show you what's going on. If CBP has a min duty cycle, that needs to be lowered. Cycle time need to be reduced as well possibly. The PID loop is not reacting fast enough (or you've got too much input) to control the system.

Hopefully that helps point you the right direction - or one of the more skilled folks with the application will chime in.
 
@LBussy I appreciate your help and input here. You pretty much nailed it exactly for what's being run.

I have a 5500W heating element that's heating 8 gallons of water, no grain at the moment, to try and tune in PID parameters for future brew settings. For the plugin (PIDAutoTune) they recommend doing a simulated mash but without the grain. So I've been setting to 154F and trying to autotune off of that. When setting up the kettle before running autotune, you have the option to change the three righthand columns on the screenshot below. Most recommendations I've seen are to increase the lookback seconds. I've tried 60s so far but I might try 120 or 180 next.

upload_2019-5-19_13-19-56.png
 
I'm not sure what "lookback seconds" is (no spare mule to install right now, but I am curious) but the basics for testing is applicable: Change one thing at a time. So if you're going to change that value; change it significantly, change only that, and see what your results are. Don't worry if it "works" but see what direction things go.

Another thing that might work is cutting down the wattage. You could cut your heat input in half by going to 110. I would not recommend changing both at the same time but if there's not a PWM setting which allows you to get the heat input low enough, that's an option. If I were developing this (and I ain't) I'd look to control that with PWM before cutting the wattage.

I looked for docs on the website but all I see is installation docs. Surely some exist somewhere?

I've always believed the best way to get the right answer on the Internet is to have someone give the wrong one. I'll keep throwing out ideas till someone who knows more corrects me. :)
 
"Under the Logic drop-down menu, choose PIDAutoTune and then configure the following options:
  1. output step %: defines the output of the autotune-algorithm when stepping up/down, e.g. output step = 100; step up (=heating) output = 100; step down (= cooling) output = -100. This setting should stay at 100%
  2. max. output %: limits the maximum power output. This is useful if your heater is overpowered and would heat up the kettle way too fast. If you don't want to limit your heater, leave this at the default value of 100%
  3. lookback seconds: determines how far the algorithm will look back when trying to find local (temperature) extrema (minima/maxima). If the algorithm recognizes even short peaks as extrema, you should increase this value. If it doesn't recognize actual extrema, you should decrease it. Usually the default of 30 seconds work fine.
    • Descriptions of settings from the CraftBeerPi Wiki"
 
New problem! My heating element turns on as soon as it's plugged in, whether the SSR is activated or not. Is this SSR shot already? I don't think it should be overheated as the entire thing is just being plugged in whenever I go to test it out
 

Latest posts

Back
Top