BruControl: Brewery control & automation 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.
I assumed the issue was with the bootloader file (bootloader_qio_80m.bin), so I pulled down the latest bits from Github for the ESP32. I swapped the latest of bootloader_qio_80m.bin into the resources folder but had no luck with it. For grins, I then swapped the bootloader_dio_80m.bin in, modified the script, and now it seems to have loaded correctly. I'm not sure what the long term ramifications are of that, and I haven't tried flashing any of my older ESP32 boards with the current configuration. I'll be curious to see if you have the same issue with the 32E version as well.
 
Ethernet and the RP-3 both use the SPI bus for communications. If there is noise on the line, for example induced by the wiring to the RP-3, it could disrupt the Ethernet communications. I don't recall your build directly, but if your interface and RP-3 are not right next to each other, this could be happening. I'll go back and look for a picture.

Edit: Went back to look for a picture. I would suggest sliding your RP-3's to the right to be as close to the MEGA as possible, and trim the wires down as short as possible. Also consider twisting them to help reduce noise pickup.
I'm assuming your talking about the SDO, SDI and SCLK wires? I am currently using Arduino breadboard wires with male pins. Wires are about 10" long, does this sound too long? Should I use shielded wire? What gauge wire should be used at VCC, GND, SDO, SDI, SCLK and CS1/4 at RP3?
 
All can. Also route them away from HV devices.


Do you have MOVs and/or snubbers in your contactor coils? These only induce noise when switched, especially off.
Yes I plan to wire MOVs to contactor coils. Correct me if I'm wrong but the issue is likely beyond that since the only components currently wired are Mega, Ethernet, RP3 and power supply. I have all recommendations (including routing away from high voltage devices) already covered with the exception of twisting the wires.

I tried a different RP3 board perhaps the issue is in one of those. It's been running all night with no issues but I'll give it a few days since I got this far with the previous RP3. I'll go to a higher quality shielded wire like the stuff I bought for RTDs.
 
Last edited:
All this information is already in this thread, if you read the manual in post 1475 I can all but guarantee half of the problems you keep having will go away.
Thankyou for the link, I'll check it out.
 
Last edited:
Correct me if I'm wrong but the issue is likely beyond that since the only components currently wired are Mega, Ethernet, RP3 and power supply. I have all recommendations (including routing away from high voltage devices) already covered with the exception of twisting the wires.

I tried a different RP3 board perhaps the issue is in one of those. It's been running all night with no issues but I'll give it a few days since I got this far with the previous RP3. I'll go to a higher quality shielded wire like the stuff I bought for RTDs.

Definitely something odd going on in this panel. The RP3 is passive, so shouldn't be the issue.
 
Attach the drain/shield wire to a ground on one end of the wire only, preferably the panel/MEGA side. Chances are higher of creating a ground loop if you attach the drain wire at both ends, and that will just cause more problems.
 
Attach the drain/shield wire to a ground on one end of the wire only, preferably the panel/MEGA side. Chances are higher of creating a ground loop if you attach the drain wire at both ends, and that will just cause more problems.
Ah took my a second, your takling about the shield inside the wire. My head went to shield like screw shield/ethernet shield. Got it thanks
 
Still having issues after adding the shielded and twisted wire. Could the Electronics Salon MD-D1125CT-1 be contributing to this issue?

https://www.amazon.com/gp/product/B01FCVZ3JE/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
If not, perhaps its something in my wiring? A few PT100s are wired (not shown) to ensure I have connection to amplifiers. THIS IS ALL THAT IS WIRED- NO SOLENOIDS, ELEMENTS, BALL VALVES ETC AND THE ISSUE PERSISTS.

Things seem fairly stable when only one RP-3 is wired and others disconnected. One board lasted 24hrs then observed a disconnect from Wiznet 5100. The other lasted 48hrs and I manually disconnected to continue diagnosis. Issue seems to be magnified as I introduce more than one RP-3 board. I observe ethernet losing connection within a few minutes whereas I get 24hrs+ with a single board.


BC Panel Power Plan.png


I'm getting desperate as our startup brewery hinges on this system quiet heavily. (10) 7-10bbl fermenters glycol control, cold storagel monitoring and hot side operations. I ordered a WINC1500 in an attempt to get this to work. Does this work on SPI BUS as well?
 
Last edited:
This is probably so simple that I will be embarrassed, but I can't figure out how you do an "if..and..else" statement in Brucontrol. So what I want to say is if x is true and y is also true then do something, otherwise (else) do something else.
Could someone please help me out?
 
When there is an if statement under an if statement its a nested if statement as RiverCityBrewer mentions... here is an example

Code:
if "FV-1 ENABLE" State == true   
    if enable_previous_state == false  
    "FV-1" Target = "FV-1 PRIMARY" Value
    enable_previous_state = true
    endif                     
else  
    if enable_previous_state == true   
        "FV-1 AUTO" State = False
        "FV-1" Enabled == False            
        "FV-1" Background = 2 
        "FV-1 BLACK" Background = 2
         enable_previous_state = false
    endif
endif
 
Thanks so much. I had forgotten to uncomment my second "endif" statement in all my iterations of the script. Because if wasn't ending it just kept plowing on ahead when I stepped through the script. It would be nice to have a Brucontrol "cookbook" that goes into more detail about how to approach problems in scripting such as the comment by RiverCityBrewer and the sample from aeviaanah above. In the meantime, thank you for your patience with my learning curve.
 
Thanks so much. I had forgotten to uncomment my second "endif" statement in all my iterations of the script. Because if wasn't ending it just kept plowing on ahead when I stepped through the script. It would be nice to have a Brucontrol "cookbook" that goes into more detail about how to approach problems in scripting such as the comment by RiverCityBrewer and the sample from aeviaanah above. In the meantime, thank you for your patience with my learning curve.
The user manual has a section or two about scripting.
 
OK, based on the quick success in getting my last query answered, here is another question about Brucontrol scripting that I can't seem to find the answer to:

I'm bringing in the data from 4 iSpindel hydrometers through node red into Brucontrol Data Exchange and storing the data in individual Global elements based on the assigned name of each iSpindel. For example, the global element for Specific gravity for iSpindel0004 is named "SG iSpindel0004" . All that works great. My problem comes when I try to assign a specific iSpindel to a specific fermenter. While it would be simple to permanently assign iSpindel004 to FV4, stuff happens to iSpindels (like low battery or need to recalibrate) or during fermentation and I want to be able to reassign a iSpindel to that fermenter on the fly. Thanks to my previous query above, I wrote a script in brucontrol that goes to two editable global elements ("Select iSpindel by number" and "Select Fermenter by ID") reads the values that are entered and then pushes the data stored from the appropriate iSpindel to the corresponding global elements associated with that FV.

That is fine as long as the global element value is hardwired into the script. For example:

"iSpindel SG FV1" Value = "SG iSpindel0005" Value (which is where the SG value is stored)

Since all my iSpindels have the same naming convention, what I want to do is read the value from "Select iSpindel by number" Global Element and insert that into the "SG iSpindel000x" Value part of the script (above) on the fly.

An abbreviated version of the my approach to the script goes like this:
new string iSpindelNumber
new string iSpindelSelectSG
new string SG

iSpindelNumber = "Select iSpindel by number" Value
iSpindelSelectSG = "SG iSpindel000" + iSpindelNumber
SG = iSpindelSelectSG + " Value"

"iSpindel (SG) FV1" Value = SG

which returns
"iSpindel (SG) FV1" Value = SG iSpindel0004 Value
which is perfect if I could somehow get quotes around the global element name so it looks like this:

"SG iSpindel0004" Value

Other scripting languages have ways to preserve the quote marks in line, but I can't figure out how to do it in Brucontrol. Does anyone have any ideas, or perhaps I am approaching the problem in the wrong way? Thanks in advance for any suggestions
 
I don't think you can use quotes (") on the name of any elements

You can use quotes around the name of an Element in scripts. You would have to use quotes if the Element name has spaces.

If you have a global element named SG iSpindel0004 , you would need to refer it on a script as "SG iSpindel0004". if you use the name SG_iSpindel0004, you can use SG_iSpindel0004 or "SG_iSpindel0004" in a script.

If you name it "SG iSpindel0004" (with the quotes), it will fail in a script.

Perhaps someone with a better understanding can chime in as well.
 
Last edited:
Finally after many years of contemplation and thanks to some extra spare time due to COVID I finally finished the initial stage of my build today. Fired the system up and everything working fine.
429EE114-1697-45B2-B281-18BA0FA46376.jpeg
CC8FA915-6E27-4221-BCCA-B504A1B394EE.jpeg
 
OK, based on the quick success in getting my last query answered, here is another question about Brucontrol scripting that I can't seem to find the answer to:

I'm bringing in the data from 4 iSpindel hydrometers through node red into Brucontrol Data Exchange and storing the data in individual Global elements based on the assigned name of each iSpindel. For example, the global element for Specific gravity for iSpindel0004 is named "SG iSpindel0004" . All that works great. My problem comes when I try to assign a specific iSpindel to a specific fermenter. While it would be simple to permanently assign iSpindel004 to FV4, stuff happens to iSpindels (like low battery or need to recalibrate) or during fermentation and I want to be able to reassign a iSpindel to that fermenter on the fly. Thanks to my previous query above, I wrote a script in brucontrol that goes to two editable global elements ("Select iSpindel by number" and "Select Fermenter by ID") reads the values that are entered and then pushes the data stored from the appropriate iSpindel to the corresponding global elements associated with that FV.

That is fine as long as the global element value is hardwired into the script. For example:

"iSpindel SG FV1" Value = "SG iSpindel0005" Value (which is where the SG value is stored)

Since all my iSpindels have the same naming convention, what I want to do is read the value from "Select iSpindel by number" Global Element and insert that into the "SG iSpindel000x" Value part of the script (above) on the fly.

An abbreviated version of the my approach to the script goes like this:


which returns
"iSpindel (SG) FV1" Value = SG iSpindel0004 Value
which is perfect if I could somehow get quotes around the global element name so it looks like this:

"SG iSpindel0004" Value

Other scripting languages have ways to preserve the quote marks in line, but I can't figure out how to do it in Brucontrol. Does anyone have any ideas, or perhaps I am approaching the problem in the wrong way? Thanks in advance for any suggestions

You could handle this with if/endif blocks. Not super elegant, but would accomplish what you want.
 
Looking for some troubleshooting assistance. I have assembled my hardware and have spent the day doing all my initial testing. Everything is working perfectly except.....my RIMs and HLT LED indicators are on constantly. I have attached my schematic. Basically I turn on the power switch. Then I energize the BruControl relay (this is my software e-stop). This powers the contactor relays and the AC relay (this supplies hot to the 120VAC receptacles). At this point the RIMs and HLT LEDs come alive. My intent is for them to only come on when the element is energized. As an aside, my circuit tester detects voltage all the way out to the elements without the SSR's being energized....is this just leakage? I did measure the voltage at the LEDs and it is 120V.

What am I missing?

Mike
 

Attachments

  • BruControlFlow-AC Enclosure.pdf
    129.7 KB · Views: 39
You could handle this with if/endif blocks. Not super elegant, but would accomplish what you want.
I'm assuming your suggestion refers to the way to solve the overall problem and not a way to add in-line quote marks where I need them. If so, yes that works, as I wrote a script yesterday for FV1. It is a relativly lot of work to script it--not undoable--just kind of a brute force find and replace in notepad++ to get everything working. If you are suggesting you could add the quote marks throungh this method, it is beyond me how you would do this, and I would be delighted to be pointed in the right direction.
 
First off... nice job on the schematic!!

Kinda leakage, but not leakage as you might think it is through the SSR... Since one side of the LED is tied to neutral and the other is tied to red (line 2), when the contactor is closed, the line 2 is live. The element is only 10 ohms, or essentially a very small resistor. The current flows from line 2, through the element to the other side of the element (black wire) where the other side of the LED is connected. If you unplug the element the LED will go out.

More importantly... how to fix? Check that your LEDs are 220V... then move the neutral line of them to line 2 bus. Ideally you should fuse that like you have done the others.

THAT SAID... you just helped me realize we are doing the same thing on the UniCon build... my apologies if that is where you got the wiring. We will need to fix this on our schematic and build. I actually made this mistake on my personal rig when I built it... you would think I would have learned the first time. I absolutely owe you a favor in return!!
 
I'm assuming your suggestion refers to the way to solve the overall problem and not a way to add in-line quote marks where I need them. If so, yes that works, as I wrote a script yesterday for FV1. It is a relativly lot of work to script it--not undoable--just kind of a brute force find and replace in notepad++ to get everything working. If you are suggesting you could add the quote marks throungh this method, it is beyond me how you would do this, and I would be delighted to be pointed in the right direction.

Solve problem yes. Inline quotes... no.
 
First off... nice job on the schematic!!

Kinda leakage, but not leakage as you might think it is through the SSR... Since one side of the LED is tied to neutral and the other is tied to red (line 2), when the contactor is closed, the line 2 is live. The element is only 10 ohms, or essentially a very small resistor. The current flows from line 2, through the element to the other side of the element (black wire) where the other side of the LED is connected. If you unplug the element the LED will go out.

More importantly... how to fix? Check that your LEDs are 220V... then move the neutral line of them to line 2 bus. Ideally you should fuse that like you have done the others.

THAT SAID... you just helped me realize we are doing the same thing on the UniCon build... my apologies if that is where you got the wiring. We will need to fix this on our schematic and build. I actually made this mistake on my personal rig when I built it... you would think I would have learned the first time. I absolutely owe you a favor in return!!

Excellent, thanks. They are 120V LEDs (I had them on hand) which is why I went the neutral route. I’ll pick up a couple 240V ones.
 
I'm sorry, I don't recall saying to use a filter. I'm no expert on serial communications... but I don't think you can use a filter on the signal lines unless it is high pass enough. We want to increase the signal:noise ratio such that it performs as expected. Best ways to do this are good wiring practice.
 
Has anyone used a small PC like a Nuc or zbox to run BruControl? I was thinking of adding one inside my panel and adding a 22 to 24" touch monitor to one of the three cabinets and high voltage in one and low voltage in the other. I also wanted to use Ethernet jacks for the I/O to sensors and wanted to know if that has been done successfully or not.
 
Has anyone used a small PC like a Nuc or zbox to run BruControl?
I am thinking of this myself, but I am not sure how to add DIN rails to the box.

I also wanted to use Ethernet jacks for the I/O to sensors and wanted to know if that has been done successfully or not.
I was going to try this (although, I am nowhere near this step). I am going to do research on the wiring first to make sure there wont be any loss.
 
Back
Top