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.
For the UniShield, I’d suggest 22AWG. Terminals can go down to 20 but 22 is readily available, has good ampacity to cover what you noted and had good durability. You can use smaller for sensors, like 28 if you want since they don’t carry current. Ethernet cable is ok but I’d avoid solid conductor in favor of stranded.
 
Progress on the AD ProOpen PLC. Have the digital outputs working (red LED).

. 55025F70-5BA5-421C-BC00-7FF7E857323E.jpeg
 
Agreed. We would still support them with jumpers rather than solder pads if we built them into the board.

Regarding 2/3/4 wire operation, Adafruit in their documentation references programming the actual MAX31865 for the type of RTD
1608128032475.png

And the datasheet says to write the D4 bit of the configuration register to match the type of RTD...
1608128266515.png

1608128293957.png


What is the BruControl implementation doing here?
 
Quick question. I am trying to perform so math in the BruControl scripting. I understand you can only do one function at a time? My hang up is trying to multiply a value with an exponent. Example 5^2=25. This format doesn't seem to work in scripting. What am I missing? In my situation the exponent is variable.

Thanks
 
Quick question. I am trying to perform so math in the BruControl scripting. I understand you can only do one function at a time? My hang up is trying to multiply a value with an exponent. Example 5^2=25. This format doesn't seem to work in scripting. What am I missing? In my situation the exponent is variable.

Thanks
To my knowledge, exponent functions are not part of the math library in BC. I had a similar need, so I offloaded that math to another platform via the data-exchange.
 
Quick question. I am trying to perform so math in the BruControl scripting. I understand you can only do one function at a time? My hang up is trying to multiply a value with an exponent. Example 5^2=25. This format doesn't seem to work in scripting. What am I missing? In my situation the exponent is variable.

Thanks

Good one! I will add exponents to the list. This is easy to do. In the meantime, you gotta do it old school. Here is a script example:

Code:
new value base
new value exp
new value result
base = 5
exp = 3
result = base
[exp_loop]
result *=  base
exp -= 1
if exp > 1
goto "exp_loop"
endif
print result
stop "script_name"
 
Quick question. I am trying to perform so math in the BruControl scripting. I understand you can only do one function at a time? My hang up is trying to multiply a value with an exponent. Example 5^2=25. This format doesn't seem to work in scripting. What am I missing? In my situation the exponent is variable.

Thanks
You can do it with a variable or global.

If you have a global value type named: Global Squared

script:
// Set Initial Value
"Global Squared" value = 6
"Global Squared" value = "Global Squared" value * "Global Squared" value
// you can the use the "Global Squared" value for what you want to do with the squared value.

You could put this in in own script:

"Global Squared" value = "Global Squared" value * "Global Squared" value

and just open that script if you are doing this multiple times. You can also get the Initial Value different ways.

What do you need this math for? I have not thought of anything that need squaring a number.
 
Good one! I will add exponents to the list. This is easy to do. In the meantime, you gotta do it old school. Here is a script example:

Code:
new value base
new value exp
new value result
base = 5
exp = 3
result = base
[exp_loop]
result *=  base
exp -= 1
if exp > 1
goto "exp_loop"
endif
print result
stop "script_name"
Thanks I will give this a try!
 
You can do it with a variable or global.

If you have a global value type named: Global Squared

script:
// Set Initial Value
"Global Squared" value = 6
"Global Squared" value = "Global Squared" value * "Global Squared" value
// you can the use the "Global Squared" value for what you want to do with the squared value.

You could put this in in own script:

"Global Squared" value = "Global Squared" value * "Global Squared" value

and just open that script if you are doing this multiple times. You can also get the Initial Value different ways.

What do you need this math for? I have not thought of anything that need squaring a number.
Setting up some carbonation features in my fermentation control. Real time CO2 vols, pressure calculator and auto spunding/ force carbonation. Takes into consideration barometric pressure and specific gravity.
 
Thanks I will give this a try!
I think this will only work for positive whole numbers. The math function I use in excel for example is EXP(-0.069589422) Where -.069589422 will be a variable but likely always a negative decimal variable.
 
Good one! I will add exponents to the list. This is easy to do. In the meantime, you gotta do it old school. Here is a script example:

Code:
new value base
new value exp
new value result
base = 5
exp = 3
result = base
[exp_loop]
result *=  base
exp -= 1
if exp > 1
goto "exp_loop"
endif
print result
stop "script_name"
I think this will only work for positive whole numbers. The math function I use in excel for example is EXP(-0.069589422) Where -.069589422 will be a variable but likely always a negative decimal variable.
 
EXP is the base of the natural logarithm (2.718). Either way, a negative non-integer requires a different approach!
Yes I am aware. My work around would have been to take the constant 2.718^(variable exponent) which like I stated will likely always be a negative non-integer. So I assume this is not possible in BC itself... is there a way to do the math in excel and have the value imported into BC? I guess I'm looking to see what my options are?
 
To my knowledge, exponent functions are not part of the math library in BC. I had a similar need, so I offloaded that math to another platform via the data-exchange.
I have never done this, would this be where I could export variables to excel to do the math and then import the value back into BC?
 
I have never done this, would this be where I could export variables to excel to do the math and then import the value back into BC?
You have the concept, though I don't think Excel is capable of performing the API calls. I use a platform called node-red to pass data back and forth via the data exchange. It requires the Pro license, but it opens up a lot of flexibility. I use it to populate recipe data via a BeerXML file, perform math that BC currently cannot do, bring in unsupported BC devices via Modbus, as well as other miscellaneous tasks.

If you are looking for the carb equation (input CO2 volume desired and temp, returns pressure needed), I have that all worked out in BC with nothing external needed, PM me your email and I'll send you the script for it.
 
I have never done this, would this be where I could export variables to excel to do the math and then import the value back into BC?

As mentioned above something like node red would be more practical than using excel. It is not trivial, but you can use something like perl or python to access excel's API through windows COM servers. Python has a module win32com that allows you to launch excel and attach to its API. You would then need some code to get the data in/out of Brucontrol to bridge the gap. That being said I would never go that route, nor would I recommend it.
 
You have the concept, though I don't think Excel is capable of performing the API calls. I use a platform called node-red to pass data back and forth via the data exchange. It requires the Pro license, but it opens up a lot of flexibility. I use it to populate recipe data via a BeerXML file, perform math that BC currently cannot do, bring in unsupported BC devices via Modbus, as well as other miscellaneous tasks.

If you are looking for the carb equation (input CO2 volume desired and temp, returns pressure needed), I have that all worked out in BC with nothing external needed, PM me your email and I'll send you the script for it.
Interesting, very interesting. Thank you @RiverCityBrewer .
Any recommendation where to start from 0 with node red?
 
The first step would be getting it installed and familiarizing yourself with the layout and add-on modules. If you have a raspberry pi, it is installed by default and really easy to turn on and play with. If you want to install it on Windows (probably easiest to install it on the same machine as BC), I've attached some instructions on how I did it. This includes the node installations required to get the XML data transfer going.

Cheers,
Joe
 

Attachments

  • NodeRedInstall.txt
    625 bytes · Views: 28
I am trying to get my PID working correctly for PWM cooling with water flow via a valve, both PID's shown here are default other than Kp being set to 10, and PID 2 being 'reversed'.

Why is there no action on PID2 when the input crosses the target?

Why is it -255, that seems very unorthodox.

How do I get a properly working PID that will have the out put go *on* when the input goes above the target?

https://www.bitchute.com/video/IS9GHXg8onDw/
 
The first step would be getting it installed and familiarizing yourself with the layout and add-on modules. If you have a raspberry pi, it is installed by default and really easy to turn on and play with. If you want to install it on Windows (probably easiest to install it on the same machine as BC), I've attached some instructions on how I did it. This includes the node installations required to get the XML data transfer going.

Cheers,
Joe
Thank you. JFYI I had to fight with last 2 commands.
 
What was the issue? I'd like to update the document.
The first step would be getting it installed and familiarizing yourself with the layout and add-on modules. If you have a raspberry pi, it is installed by default and really easy to turn on and play with. If you want to install it on Windows (probably easiest to install it on the same machine as BC), I've attached some instructions on how I did it. This includes the node installations required to get the XML data transfer going.

Cheers,
Joe

Post went too quckly , I was about to type it in.
So I had issue with:
npm install node-expat
npm install xml2json

it was failing i with an error
Warnin
Warning: Missing input files:
C:\Windows\system32\node_modules\node-expat\build\deps\libexpat\..\..\..\deps\libexpat\version.c
MSBUILD : error MSB1009: Project file does not exist.
Switch: build/binding.sln


Solution I found here: MSBuild.exe ENOENT - uses VS2019 instead of VS2017 - node-gyp

Code:
node-gyp v5.0.0+ is out with Visual Studio 2019 support. It's not yet integrated into npm so it has to be installed manually. This should do it (only need to be run once):


Windows Command Prompt:

npm install --global node-gyp@latest
for /f "delims=" %P in ('npm prefix -g') do npm config set node_gyp "%P\node_modules\node-gyp\bin\node-gyp.js"


Powershell

npm install --global node-gyp@latest
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}

After that reboot is needed. Only then 2 last commands will install modules.

Please note I am complete noob, it could be there are better solutions. :)
 
Last edited:
I have been fighting all day to install VS 2019 and get node-red on the latest insider build... There is always tomorrow.
 
@purdman10, you are not alone :).
I dislike those kind of installations on Windows, as I wanted it side by side running with my BruControl... In my view, this one is not straightforward and there are tons of different versions and dependencies which are nightmare for beginners like me. Node JS installed OK, then I installed node-red (using npm as on the link) that worked fine too. But for installing those additional modules I spent yesterday good 3h to make scripts run without errors. As a framework, I was following what @RiverCityBrewer wrote + follow the links within the txt.

Also as mentioned I had trouble installing modules: node-expat, xml2json. Honestly, I am unsure about what I did actually helped ( check my previous post).
If it helps - I remember installing and de-installed node-gyp several times, also installed some version of VS2019 in addition following some post, rebooting - then it suddenly installing additional modules worked, so I can't really say :-(. When these modules are OK they appeared on my side as folders under "C:\Users\{user}\node_modules".


Starting server works, connection to interface gives me the UI, so back to learning mode :)
 
Last edited:
My plan is to update my Pi 4 thread once I iron out difficulties for the 64 bit 2127.1000 developers build. As an aside on board bluetooth driver works... sound now through a bluetooth speaker.
 
I am refining and reworking the BruControl Application Scripts and Workspaces.

I am currently using 1.9 beta because of the new Alias for an Element Name which I have gotten to work well as I renamed my Elements and used Notepad ++ to search all the scripts at once to replace the names of the Elements. I named the Elements in such a way that I would not have any conflicts with similar names.

The new location and size boxes on appearance are a great help in exact sizing of similar Elements and their alignment.

I still have a slight issue when I open an Element's properties with the Circle I when I want to change a property. It may slightly move or resize the Element. This is especially true on smaller Elements.

It would be great to have a lock on the size and location of an element, that locks those attributes even when the application is unlocked.

location and size lock.png

You can see my naming convention for my Brew Kettle Target. glbV_SetPointBK_B1 is a Global Value Type that is on my B1 workspace. I can manually change the target on the Workspace and have a looping housekeeping Script that resets the Target on the Brew Kettle PID.

My Blue Pump, which used to be "Blue Pump" is now MB_33_do_BluePump_B1. The Display Name is "Blue Pump".

It is on the Main Brewery Interface Port 33 as a Direct Out and also on my B1 Workspace.

I find it helpful to know which workspace an Element is on sometimes when troubleshooting as I stacked Elements at the same location and cannot find it if hidden in a stack. At least I know which workspace to start looking for it.

Using the Display Name, File Index and background has cut my Alarms down by 1/3 of what they were as I can reuse the Alarm 3 times. (Still wish I could set the path for the wav file and background image in slot 1 so I could use one Alarm only many times over)
 
The 64 bit 2127.1000 has too many issues to run BC and node-red. I backed down to 32 bit 20H2 which runs fine on the Pi.
 
My instructions were based around Windows Server 2012R2 and Windows Server 2019 1809 LTSC. I much prefer the LTSC releases over SAC, but in many cases, I'm in the minority on that issue.
 
Back
Top