• Please visit and share your knowledge at our sister communities:
  • If you have not, please join our official Homebrewing Facebook Group!

    Homebrewing Facebook Group

BruControl: Brewery control & automation software

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Had a bug happen today, which happened before. Script changes setpoint on PID. The setpoint does change, but the PID keeps going to the previous setpoint. Example, PID at 150, script drops to 145, PID shows 145, but still driving like maintaining 150, have to disable/reenable to fix. Mega, serial connection.

Also,
ESP32 stuck in disconnect loop again. This time was not caused by cpu restarting. This was during mash with active PWM output going to pump. It was still driving the pump, but was disconnecting/reconnecting in a loop. Serial connection, does have resistor per user manual.
 
Had a bug happen today, which happened before. Script changes setpoint on PID. The setpoint does change, but the PID keeps going to the previous setpoint. Example, PID at 150, script drops to 145, PID shows 145, but still driving like maintaining 150, have to disable/reenable to fix. Mega, serial connection.

Also,
ESP32 stuck in disconnect loop again. This time was not caused by cpu restarting. This was during mash with active PWM output going to pump. It was still driving the pump, but was disconnecting/reconnecting in a loop. Serial connection, does have resistor per user manual.

Can you send us the device log from the day this happened? (zip and email).
 
I guess I meant the quality of the power supply. 12V can sometimes overload the MEGA's regulator. What else is powering it?
I’m not sure how to quantify power quality. This power supply is dedicated to the mega, no other device uses 12v. It is however a cheap step down transformer.
 
I have gotten a lot of help from everyone on my BruControl journey so far and wanted to give back a little. I haven't seen much if any info on the JSON import to Global Variables. I saw the info Die_Beerery had put out as well as his YouTube video showing the use of Node-RED. I wanted to do something similar using BrewFather rather than Beersmith and I didn't want to have to install anything else on the computer I run BruControl on since it is a virtualized application run on Citrix XenApp. I ended up using Microsoft PowerShell to take the JSON that natively comes out of BrewFather, do any volume, temperature, time conversions that I needed to do and then insert those values into Global variables within BruControl using the data exchange service. Therefore I don't have to have any additional software other than BruControl and Powershell which comes with Windows. I implemented a FileWatcher in PowerShell that starts the import script anytime a json file is exported from BrewFather, very similar to what Die_Beerery did with the file watcher in Node-RED. I have included just a snipet of the code with the import and export pieces. My total script ended up being about 1000 lines of code but I am importing brew and fermentation information. If anyone would like more information on how to do this or have any questions please don't hesitate to reach out. I am happy to help where I can.

Code:
# Get Data from BrewFather json export file
$FileData = Get-ItemProperty -Path "C:\Users\Garrett\Downloads\*.json"
$BFData = Get-Content -raw -path "C:\Users\Garrett\Downloads\*.json" | ConvertFrom-JSon


# Extract Brewfather Data into variables

#Recipe Version
$Version = $BFData._version

#Batch Number
$Batch = $BFData.batchNo

#Recipe Type
$BatchType = $BFData.recipe.type

#Yeast Name
$YeastName = $BFData.recipe.yeasts.name

#Yeast ID
$YeastID = $BFData.recipe.yeasts.productID

#SRM
$SRM = $BFData.color


# Build BruControl JSON file from data pulled from BrewFather extract file
$Data = @(
    [ordered]@{
        Name  = "Version"
        Value = $Version
    }
    [ordered]@{
        Name  = "BatchNum"
        Value = $Batch
    }
    [ordered]@{
        Name  = "RecType"
        Value = $BatchType
    }
    [ordered]@{
        Name  = "YeastName"
        Value = $YeastName
    }
    [ordered]@{
        Name  = "YeastID"
        Value = $YeastID
    }
    [ordered]@{
        Name  = "SRM"
        Value = $SRM
    }
)
$json = $Data | ConvertTo-Json

$url = "http://localhost:8001/Globals"
$response = Invoke-RestMethod -Uri $url -Method PUT -Body $json -ContentType 'application/json'

Garrett
 
I’m not sure how to quantify power quality. This power supply is dedicated to the mega, no other device uses 12v. It is however a cheap step down transformer.

Usually weird behavior in micro-controllers stems from power problems. So a quality switching supply should always be used... not a wall-wart or phone charger. With proper power, it should run forever with no hiccups. We have a handful of micros running >4 years without a glitch (good power + battery backup).

Also, in terms of debugging, I would recommend removing all the devices that are wired in to see if the problem resolves - it then is likely one of the attached devices. In our case, these can impart noise or draw too much current - which will cause issues. The goal is that you should have 100% reliability - not occasional missteps.
 
I’m not sure how to quantify power quality. This power supply is dedicated to the mega, no other device uses 12v. It is however a cheap step down transformer.

Usually weird behavior in micro-controllers stems from power problems. So a quality switching supply should always be used... not a wall-wart or phone charger. With proper power, it should run forever with no hiccups. We have a handful of micros running >4 years without a glitch (good power + battery backup).

Also, in terms of debugging, I would recommend removing all the devices that are wired in to see if the problem resolves - it then is likely one of the attached devices. In our case, these can impart noise or draw too much current - which will cause issues. The goal is that you should have 100% reliability - not occasional missteps.

I had similar issues a while ago, very frustrating diagnosing the problem but eventually found a solution that worked for me. It turned out my dedicated 12VDC power supply (good quality) was overwhelming the voltage regulator on my MEGA (RobotDyn). See posts #2753 and #2759 in this thread for the solution I used. (Parts list #2764) Rock solid ever since.
 
Last edited:
I had similar issues a while ago, very frustrating diagnosing the problem but eventually found a solution that worked for me. It turned out my dedicated 12VDC power supply (good quality) was overwhelming the voltage regulator on my MEGA (RobotDyn). See posts #2753 and #2759 in this thread for the solution I used. (Parts list #2764) Rock solid ever since.
Where the heck is the post number on mobile version of website?
 
Is PID suitable for contactors or only with SSR?

I have (3) 50amp contactors controlling (3) elements in kettle and was thinking of running a hysteresis device utilizing digital outputs to turn on or off each 12kw element. Any interface suggestions to improve kettle heat control?
 
Depending on the duty cycle, you might get away with appropriately sized contactors. They are typically rated for hundreds of thousands or millions of cycles. [blasphemy ON] You don't really need PID to heat water. Assuming it is mixing well and the lag between it being heated and the temp measured is low, you can easily just use a hysteresis mode and get very stable temps [blasphemy OFF].
 
Ok thanks for the help. What is pulse width modulation and what are you guys using it for?
 
I use PWM with an analog amplifier board to control proportional valves, and I suppose one could use PWM to very precisely control electric heating elements via a phase angle SSR or SSVR. I'm sure there are other uses, but nothing immediately comes to mind.
 
I visited the posts you mentioned. What exactly is the “power boost”?

That part is essentially a rapid charger for lithium batteries that provide backup power to the MEGA in case of a power blip or outage.
 
That part is essentially a rapid charger for lithium batteries that provide backup power to the MEGA in case of a power blip or outage.
This guy? https://learn.adafruit.com/adafruit-powerboost-500-shield-rechargeable-battery-pack

https://www.adafruit.com/product/1944

i see the benefit of having power during the blip but what’s the benefit during an outage? Won’t everything else be de energized and the Mega running by itself?

I have the immediate option to bring 5v to supply Mega. Would this be better than the current 12v?
 
Last edited:
This guy? https://learn.adafruit.com/adafruit-powerboost-500-shield-rechargeable-battery-pack i seethe benefit of having power during the blip but what’s the benefit during an outage? Won’t everything else be de energized and the Mega running by itself?

I have the immediate option to bring 5v to supply Mega. Would this be better than the current 12v?

The benefit of keeping power to the controller is that all of your devices, energized or not, are in a known state. This way, when the power does come back on, valves, pumps, heating elements, etc. don't randomly cycle on/off as the controller does not have to reinitialize its I/O.
 
New version with Alias?
MCNBgf5.png
 
i see the benefit of having power during the blip but what’s the benefit during an outage? Won’t everything else be de energized and the Mega running by itself?

I have the immediate option to bring 5v to supply Mega. Would this be better than the current 12v?[/QUOTE]

In my circumstance I tried using a dedicated 5VDC power supply via VIN but was still a no go. Although the disconnects were diminished they still occurred. At that point I decided to go with the 5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable. This directly plugs into the micro USB on the MEGA and eliminates the VIN hookup altogether.

For the PowerBoost module as @RiverCityBrewer mentioned it keeps the devices alive in the last known state before a blip in power. Another added bonus to using the Power Boost board is that it allows me to disconnect the larger USB cable from it and plug into my laptop for updates to BC. It eliminates the screwing around with the micro USB on the MEGA board, possibly damaging it. The power boost is not required if you don't require it. I looked at it as an added benefit for my setup.
Basically the setup is the Power Supply Micro USB cable-Into Power Boost Board-Out of Power Boost Board via large USB to Micro USB adapter cable- Into Micro USB of the MEGA.
Eliminate the battery backup and its a direct connect Micro USB from the power supply into the MEGA.
Edit... This is the one I used https://www.adafruit.com/product/1944 + https://www.adafruit.com/product/1995
 
Last edited:
For example, on my refrigeration interface, it has a battery backup. Should there be a big power failure and my BC running PC not restart (Murphy's law), then the re-started interface will not know what devices should exist and be active... so the refrigeration would not continue. Battery backup prevents this.

That said, we did add the ability to store a "default state" for interfaces, that start up with certain devices active. This doesn't replace a battery backup, which will keep an interface status quo, but it certainly sets it to a known state.
 
We’re nearing completion on our 3 head keg washer. We are using a PLC (Unitronics V350) with touch screen to control ball valves, I wished we would’ve used BC but the build was in motion before I was comfortable with BC or automation in general. Our friend who is helping us with the electrical mentioned to use a PID or a temperature transmitter for the PLC. I like the idea having PLC control heat but don’t like the price tag. Does anyone know a more cost effective way of allowing the PLC to have control over the element?

the transmitter he linked
https://www.automationdirect.com/ad...=FC-T1&categoryId=0&TxnNumber=-1&searchqty=10
 
Last edited:
A lot is going to depend on what PLC you are using? I work with AB/Rockwell gear... I wish I could get a transmitter for $100. Typically you add a 0 and start there :)
 
Back
Top