Forum

Notifications
Clear all

New Build

52 Posts
2 Users
1 Likes
28.7 K Views
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
Topic starter  

Since this is a slave Mega 2560, which firmware option do I use?  

 

The master will be BruControl.43.Mega.FR.hex

 

I assume I wire from the master to the slave and not another Ethernet or USB connection since I want the master to control the slave

 

I may add an RTD shield to the slave if that makes a difference


   
ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 7 years ago
Posts: 343
 

Hi @oakbarn... there is no master/slave arrangement for interfaces. In BruControl, the computer running the application is the master, and the interfaces are slaves. Therefore, if you have two MEGA's, BruControl is the master, and both MEGA's are slaves.

Hope that makes sense... if not, please let us know what you are trying to accomplish and perhaps we can provide some direction. Also, it might be worth a review of the manual to help understand the topology (though admittedly topology may not be directly discussed this way).


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
Topic starter  

O.K.    My plan is to expand the number of outputs/inputs

Does each Mega run its own script and act independent of the other? 

 

I did go through the documentation and did not see anything about using two or more Mega 2560s at the same time.  

 

Not it sure how they would be hooked up. SDA and SDL busses connected? Or each be networked to the PC? 

 

I guess my issue is that I know how a BCS works and want to expand on that.   I currently use 2 separate BCSs. I have run out of probes and outs on those.   I wanted to add about 15 valves to what I have and 3 probes.   In addition I want some Hall effect sensors as well as the pressure volume measurement widgets. 


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
Topic starter  

O.K.    My plan is to expand the number of outputs/inputs

Does each Mega run its own script and act independent of the other? 

 

I did go through the documentation and did not see anything about using two or more Mega 2560s at the same time.  

 

Not it sure how they would be hooked up. SDA and SDL busses connected? Or each be networked to the PC? 

 

I guess my issue is that I know how a BCS works and want to expand on that.   I currently use 2 separate BCSs. I have run out of probes and outs on those.   I wanted to add about 15 valves to what I have and 3 probes.   In addition I want some Hall effect sensors as well as the pressure volume measurement widgets. 


   
ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 7 years ago
Posts: 343
 

Yes, they run independent of each other but are all controlled by BruControl. So to you, the user, it’s all transparent. For example when you or a script turns on an output, it may be on one of many interfaces, and you don’t really care which because it will be wired to turn on the device you want. 

Each interface (MEGA) is networked with the computer - not with each other.

You will be able to add ad many outputs, inputs, sensors, etc. as you like. And anytime you wish to expand, you can just add another interface. They can connect to the computer directly via USB or via Ethernet or WiFi network. 


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
Topic starter  

Since they are independent, I would assume each Mega would be running its own Script.

Can you call to Mega 2 :Script from  Mega 1: Script?

I would assume "No" since all variables are local.  I see that you plan to have Global Variables in 1.1.  

 

Are those still only Global to the same Mega, or universal to the Windows IDE.

I understand about being able to control both Mega(s) withing the same IDE, but the actions would be independent on each Mega?

I know these questions are from a general lack of knowledge on how the Mega works.

 

 

I will be trying to write a simple script to display a Temperature.  I have a one wire that I will be working with.

I also assume that I can overwrite a Firmware with different options (Serial vs Network, etc)

 

 

 

 

 

 


   
ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 7 years ago
Posts: 343
 

Hi oakbarn,

The interfaces (MEGA in this example) do not run the scripts - these run on the computer. And for the record, you don't need to run any scripts. You can create a digital dashboard full of "Elements", and control everything manually. For example, you do not need to write a script to display a temperature. You just create a Device Element (tied to that pin/port combination), and the Element shows the temp.

The scripting creates automation of the Elements, should you want a higher level of automation. For example, you could start a timer once the temperature reaches a certain threshold. Or count how many times a temperature exceeds a threshold. Or whatever you want to do with the temperature value information.

Think of the MEGA's as dumb extensions of the BruControl application. You perform all what matters in the application, and the interfaces handle that 'interface' to the physical world. The application hands off instructions and inquiries to the interfaces. To the user, it is all transparent. Looking at the user interface, you wouldn't know if there is one or one-hundred interfaces. You would just know that when you turn a device on, it turns on, etc.

I can appreciate that you are trying to understand how it works under the hood, and I am happy to share details about that. However, my recommendation is you concentrate on the application rather than the hardware.

Yes, the different firmwares are cor different microntroller boards (MEGA, Feather, etc.) and different connectivity they will be using.


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
Topic starter  

I do understand about automation/manual control  and displays.  When I first got my BCS 462 I was able to display the Temps but little else.  I know that I need to get into the scripting for any automation.  I think of these as Steps in a Brew Day.  This is my very first attempt at the script and some syntax is missing as I have not delved to far into it yet but this is the general idea for my first Step: Filling my 75 Gallon Big Mac HLT.  It has a 5500w 240 Element and Temp Probe that I will later use Hysteresis to control (electr0-mechanical contactor).  The syntax may be wrong as this is my first quick script.

 // Step 1: Fill my Big Mac 

//Device Element  Woirkspace "Brewery">"Big Mac Valve" >Digital Output(Pin 6:Port 6)

// Device Element Woirkspace "Brewery">" Big Mac Float"  >Digital Input: Pin 49:Port 49) 

 

//  IF "Big Mac Float" = False    "Big Mac Valve"  = On

//IF "Big Mac Float" = True   "Big Mac Valve"  = Off\>\ Goto Step 2

New bool BigMac_Float 

//Big Mac Fill Function

Step1

BigMac_Float  = "Big Mac Float"

// Not sure of Syntax but I want to get the state of the float (Port 49)

If  BigMac_Float = False

      "Big Mac Valve" = On

      Goto Step1

Else

    "Big Mac Valve" = Off

     Goto Step2

End If

Step2

........

 

 

 


   
ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 7 years ago
Posts: 343
 

Definitely true that for automation, some script implementation is needed. One thing to think about BC's difference from BCS is that the BCS operates on "states". States make things easier to set up but are very limiting, as you need a defined state for every possible scenario. This is easy when you have a small number of I/O, but does not scale well when your I/O gets above a handful.

BC's scripting affects changes, not states, and you are basically unlimited to manage any scenario. This flexibility comes at a bit of a cost - investing your time to learn and test scripts. I think you'll find it really effective once you get the hang of it.

Your script is directionally correct, but you are right... the syntax won't work. Consider that every device or object needs a property addressed. For example, 

IF "Big Mac Float" = False

will not work, whereas

if "Big Mac Float" state == false

will.

I suggest you get the wiring and Workspace operational before sweating the scritping / automation... but I'm digging your enthusiasm!


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
Topic starter  

Well I am setting it up on a small scale to do some testing of my scripts as I write them.  I have four one wire probes and will set up a push button switch to test any digital inputs.  I will have a couple of LEDs to test the outs.   I want the programming setup first as I will be changing out the controller once I am comfortable with it

 

I do realize that the "States" are limiting on the BCS because you can only have 8 and those belong to only 8 Processes so only 64 steps available.   I like the idea of an entire Brew Day with all of the Steps being within one script, although I may still separate into more than one or more so as to have the variables easy to set at the top.  

Right now I have 3 files under the c:\documents\brucontrol

I assume there will be more.  Can you save and replace these files on the run.  In other words, have a file with my settings in one file and a script for my "Raymond's Best Bitter" in a script file.  When I want to brew "Pivo Doskocil", just replace the script file with my "Pivo" one.  I know that the "who is on first" issue comes up if you change and named devices or Pins/Ports.  Once the Hardware is wired and Settings complete, I would change nothing in that.


   
ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 7 years ago
Posts: 343
 

You do not edit script files in the folders. In fact, you never need to look in those folders. The application will hold all the scripts you put in it and you can organize and run them as you see fit.


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
Topic starter  

Think I am starting to understand more.

I assume Active Low on a Digital Input is changing the input to NC (normally closed) so the Value would be "On" when not powered. If not Active Low, then NO (Normally Open)

For a Digital Input Switch, do I just run 5+ to the Pin broken by the switch or do I need any resistors in the circuit?  Probably on one of the schematics but not sure which one to look at.

Addition Hardware Question.  I see that you need:

Board to easy hookup 6 BCS type Probes (ordered from you already)

Board for 4 RTD probes with additional amplifier for each probe  (ordered from you already and amps from adafruit)

4.7 Ohm Resistor and breadboard for 1 wire probes (ordered from amazon).

Do you need any other resistors/boards for Digital Inputs or Outputs?

 


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
Topic starter  

Ok  I found the answer to the second question.  You do need a 10k Resistor for switches that are NO and not set to Active Low.   There is no need for  a Resistor for a Digital Input set Active Low.  Not sure that I understand the terms Sinking or Sourcing Types but will research on Google.  I guess it does not matter for a switch that is used for script flow control.   I will have to wrap my head around floats switches.  Mine are physically set to NO now.  If I set the Device Input to Active Low, I could wire it direct without the resistor?


   
ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 7 years ago
Posts: 343
 

Active high or low refers to the voltage state of an input or output when the device is considered ON. For example, if you put 5V to an input pin, it will be high. In the software you decide whether you want that to be called ON or OFF. If ON, it’s Active High. If OFF, it’s active low. And vice versa. 

So using NO / NC switch doesn’t alone decide... what that switch  is connected to does. If it switches ground, you’ll be looking for an active low signal, if 5V, then active high. 

Thay said, a regular switch will connect or break a connection to 5V or ground, but it can’t switch both. Meaning, if the switch is closed and connecting to 5V, when it opens, it is not connecting to ground - it’s floating. To make sure an input sees a ground state, a pull-down resistor of high value (say 50 kOhm) should be connected to the pin. This will make sure the input sees ground when the switch is open and 5V when closed. 

Sooid state switches are considered sinking if they pull-down (apply ground) to the input they are connected to  likewise they are considered sourcing if they pull it up (apply positive voltage) .

BTW, the BCS uses active high for both inputs and outputs, so if changing to a MEGA, I suggest you stick with active high configurations.

Question: why do you want to use 3 different probe types? I suggest you pick one and stay with it. If you are using thermistors (BCS), then only use thermistors and not RTD or 1-wire. 

Perhaps post a schematic if what you are looking to do? 


   
ReplyQuote
(@oakbarn)
Trusted Member
Joined: 5 years ago
Posts: 64
Topic starter  

Why three different Probes?  Because I already own them.  I had Aubrin's Pids with RTD before the BCS.  The BCS has its own Probes.   The One wire are cheap enough and I need more probes as I like to measure in lots of places.   I have up to 5 fermentations going on at a time.   I have 4 Storage Freezers that I keep at 35 degrees.    I have a Kegerator.  I have 4 probes on my large Mash Tun  (two associated with HERMS. I measure the MLT Out and the MLT Return).  I have the HERMS Bath.  We normally brew 2 batches at a time so I have another Mash Tun.  I have cooling water. Two Brew Kettles.  My Big Mac 75 gallon HLT, Glycol Bath, Cool Room Temp    ......  We have a lot of toys.

I also want to play with the capabilities of BruControl.  The one wire seems easy.  I have also had issues with EMI so I want to see if there are better.  I have had to replace probes on the BCS over time and they are $$ vs $ for the one wire.  In fact, I could replace all my BCS probes for the cost of a couple of replacements.

My problem is that I have never used an Arduino or Raspberry PI.  My only foray into soldering was for M12 Quick disconnects and using resistors to lower voltage for some LEDs when a Valve is open.  I am a real newbie at the hardware and the Scripts.

 

I think I will find the Scripting fairly easy once I learn the syntax and foibles of it.  I know Visual Basic for Applications very well and have written some JavaScript so Scripting should come fairly quickly.

I will learn about the Hardware as needed,

 

That being said,  can I  just run the 5v to one side of a switch and connect the other pole to the PIN/Port on the Mega with no resistors as Digital Input?  You only need the resistor if Active Low?

I have momentary Push Button (NO) switches in my Brewery that I use to advance my steps.   In the BCS they are one shot DINs.  I would hope to use these as Inputs on BruControl as well.    I use them when I want to advance the Script to another section.  Right now, I have different switches (Inputs) to branch the flow depending on which button is pressed.   I use them when I am doing something like adding the Grain Manually and ready to proceed with the Mash.  I like having a switch on the wall so I do not have to touch the computer (which is in a different room).  I also have Float Switches that I use to shut off valves.    I plan to Miracast or Remote for a Display in my Brewery.  I have a 50 inch TV that I watch my progress now that is mounted above my brewery.  Regardless, I can go through a Brew Day and rarely need to touch the computer.

I am doing my own version of a plan to integrate or replace the BCSs that I have.  Unfortunately, I need to understand BruControl before I can proceed to formulate a plan.  I plan and setting up some simple scripts and use switches for my inputs and LEDs for the Outputs.  I will also use a one wire sensor for control.  I have a small 110 vac cup heater that I have used to simulate an element.  I have a test rig that includes the SSR all set for that.  Once I understand Brucontrol better, I will formulate the Plan.    I want to add quite a few SS Ball Valves in my manifold to control flow.  I also have 5 pumps but due to the lack of available Outs on the BCS, only two are automation controlled.  

 


   
ReplyQuote
Page 2 / 4
Share: