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 am going to ask that you put the time into providing a detailed, readable, 100% accurate 'as-built' wiring diagram for your specific setup, including every wire...... there are a lot of people on here willing to help, including some of us being bona-fide electrical engineers that are more than willing to help, but don't want to spend a time guessing what is there, but not described... (a contactor in series with a ssr to run a 5500w element is not inherently a problem, in fact that setup is the most common and outlined on TheElectricBrewery ) pictures are better than words, but following wires in a picture is often difficult. Additionally, creating the drawing may solve this problem and having the drawing will help you find future problems.
 
@clearwaterbrewer That's fine--I'll get my wiring diagram updated when I have time. I certainly don't expect in-depth troubleshooting in the absence of in-depth information. I'm just looking for obvious gotchas in the meantime.
 
Sorry I wasn’t clear—I have 2 5500 watt elements that are controlled by SSRs as usual, but they are also physically switched on via DPST contactors. This is so both hot lines to the elements are disconnected unless I have “activated” them. This requires that the contactors’ coils be powered, which is controlled via the relay board. The relay board is just acting as a switch to enable each element.
Sorry, I think I was just misreading what you wrote.
 
Last edited:
Sorry for the delay responding... Something isn't right. At the end of the day, all of these micro-controller boards have direct connections between the chip and terminals. There is no hardware buffering, so we need to treat them with kid gloves (electrically speaking). The rugged model does have a fair amount of hardware buffers, but as you said, you pay for the privilege. I haven't tested one, but I am confident the firmware will function correctly as the main chip is the same.

Most problems start with power supply issues. Make sure your power supply is a quality switching unit, and ensure the output is actually 12V. Then attach sensors and switches one by one. I suggest you measure the current passing out of the MEGA's pin into the other devices to ensure nothing is going over limit. Do you have a volt-ohm meter with milli-amp current measuring capability?
 
I just screw the wires straight in bare.

My sensor wires are very small, so the screw terminals have a hard time locking them down. The pins on the jumper wires break off if moved even a little. I’m trying pin crimp connectors next. I’ll report back.
 
22 AWG wire should make a very reliable connection to the screw shield terminals. Perhaps the wire you are using is finer.

That said, I would use round crimp ferrules. They are used in industrial applications, are not expensive, and make wiring easier overall.
 
Looking for advice to deal with EMI. As others have experienced, when operating solenoid valve and pumps, everything goes haywire. I've been reading here how to address this. I've ordered diodes for the solenoid valves. Should be able to try that tomorrow. For the pumps 110VAC, I used the 100 ohm and 0.47 mF in parallel with the pump. That definitely improved things. Now, only the temperature sensors go crazy when I switch on or off the pumps and even then, not every time. Before the mod, the temperature sensors going crazy was best case scenario... Sometimes all the devices would go offline (not good).

So question is how can I keep improving on this? Would the varistor option be better? If so, I don't know what to order. Thanks
 
The keys are isolation and suppression. Proper grounding into a STAR pattern matters too to eliminate ground loops.

1. Separate high and low voltage wires. Eliminate loops where possible - they act as antennas.
2. Use shielded wire, with the shield tied to ground at the enclosure side only. Or use twisted wire - this reduces antenna affect.
3. Use solid state or electric switches (relays, e.g. SSRs or MOSFETs) over electromechanical ones (cube relays) where possible. For inductive loads, for DC circuits, use reverse-biased diodes (e.g. 1N4007) and for AC circuits use MOVs (Metal Oxide Varistors) and/or snubbers (R-C network).

For the MOVs, we have tested these with good success. Anything for 120V will likely work though: https://www.digikey.com/product-det...onic-components/ERZ-E14A201/P15585-ND/3694124
 
Thanks BrunDog. A couple follow-up questions if I may:

The RC network I added made significant improvement but upon further testing, it is not just the RTDs that go out of whack when I switch the pumps on and off, occasionally, the whole thing still crashes. Now I'm not sure what that means - I assume its the MEGA that crashes (all the devices go offline for a few minutes). That's the main thing I want to avoid for obvious reasons. Now based on your response above, I've got some work to do to improve my design. I'm wondering from the symptoms I describe (the MEGA crashing) we can narrow the source of my problems and figure out where I should start?

Clearly, my RTD wires are way too long and coiled in some places (I need to address that). Do we think that this could cause the MEGA to crash? Or should I look for other issues (like my grounds)?

I've put the RC network in parallel with the pumps. Your EMI protection schematic says to use the RC network, MOV or both. If I use both, I'll put them both in parallel with the pump?

My RC network is not at the panel, but it's not right next to the pump: it's at the outlet (the pump has its own 120 wire). Should I hack into this wire to put the RC network closer to the pump?

Finally, the diodes I ordered for the 12VDC solenoid valves are 1N4001. Will this work, or do I need 1N4007? Or would 1N4007 be better somehow?

Thanks much! Getting close to my first batch with BC.
 
Well I'm happy to report that the diodes work perfectly. Even the RTDs are unaffected by the solenoid valves now. Only pumps and contactors left to address.
 
OK, good news on the diodes. If you are getting crashes (meaning resets), the EMI is really significant. Don't try to figure out differences between resets, spikes, offline/online... it doesn't matter. We are aiming for it to work without hiccups no matter the circumstance.

Regarding wire lengths, I can only speculate. Without schematics/pictures it is difficult for me to offer any solid advice. But more shorter = more better and more shielded = more better too.

If you use both snubbers and MOV's, yes: put them in parallel with the pumps as close as practical to the pumps (electrically speaking). No need to move them IMO.

The 1N4001 are fine - and it sounds like they are working - so good!
 
@BrunDog, let me know if this is getting too far afield and I should take this over to my own thread. Below is a complete, current diagram of my wiring as it exists currently. As you can see, I do not have a ton of things connected yet, as splicing/soldering all of the thru-panel connections for my valves is taking a while. I currently have one each of my 3-way and proportional valves connected, along with all 3 of my RTDs (and their amplifier boards).

@BrunDog, my 12v and 24v PSUs are both MeanWell DIN PSUs from Amazon. I assumed that, while they're not the greatest PSUs in the world, they are fine. Both output the correct voltage, as read by my multimeter (12.07v and 24.05v, respectively). My 5v PSU is a little Chinese PSU from Aliexpress--but it outputs 5v and is currently only connected to the 5v multi-SSR board, and not directly to the MEGA, so I doubt it's that. I've ordered some of the MOVs that linked above and I'll connect them across all of the contacts on my relay board.
Adam BruControl Dual Element 240VAC 50A.png
 
I think this can help people, so OK by me to leave it here. I can't see that you have things unterminated - did you mean to include a picture? Or did you mean that the "unconnected" terminals in the schematic are not yet connected?

Power supplies should be OK. Do you have all the grounds tied together to one point?
 
So, I used the install tool to configure the network, but still no dice. It flashes the firmware and looks good, but when trying to config the network it just doesn't want to talk any more. Entering the %0&15; command produces no response from the ESP. Just to make sure I wasn't crazy, I used a D1 mini (not lite) that I have running another project, blanked it first, then uploaded the Brucontrol firmware and tried configuring the network on it. Same result, could not get any response from the terminal window when entering the config command.

@phreaky : sorry for the delay. I just tested a Wemos D1 with Firmware v43 and it flashed properly, then I was able to communicate with it correctly to set up the network. I can shoot a video but it would be like the one on the website.

Are you sure you have the correct serial communication driver installed? On my computer, under Device Manager, I see 'USB-SERIAL CH340)' when the D1 is plugged in under Ports. The driver is 'CH341S64.sys'.
 
I think this can help people, so OK by me to leave it here. I can't see that you have things unterminated - did you mean to include a picture? Or did you mean that the "unconnected" terminals in the schematic are not yet connected?

Power supplies should be OK. Do you have all the grounds tied together to one point?
Re: the diagram and things that are unconnected--there are a few signal lines that I did not delete from the wiring diagram (because I'm going to put them back), but I did disconnect everything from the "MEGA" in the diagram if it is not connected IRL.

Grounds: All of the AC grounds are tied together at the grounding post in the enclosure, to which is also tied the incoming ground from the 14-50 plug. All of my DC grounds are currently separate: the 12v GNDs go individually to a 12V power distribution block. The 5V SSR board's GND goes to the 5V PSU's GND. The 24V GND goes directly to the PSU (but when I add more 24V things, I have a terminal block for 24V (+) and GND). At present, only the 12v ground is connected to the AC ground.
 
Last edited:
BrunDog,
I did my first batch with BC today (in manual mode - still working on the script). One thing I experienced was during the boil, the pressure transducer (mounted under the kettle through the plywood desk) could not maintain a reasonable value. Over the course of the boil, it got progressively hotter and indicated (incorrectly) a decreasing volume. Now, I expected a piezo electric crystal to behave this way, only the magnitude of the decrease as a result of the heating was too much to make the transducer usable for me during the boil. I'm wondering if you have thoughts on how to address this? Have you tried a fan (I'm thinking this won't be enough) or circulating cool water in tubing around the sensor? Your thoughts are welcome. Thanks.
 
So has anyone noticed if the original wiznet 5500 series of Ethernet shields seem to be sensitive to the length of cable? I have my second fermentation panel setup and working in the basement of the brewpub and everything was fine until I switched to a longer ethernet cable to move the router across the room and now I keep randomly losing communication which didnt happen with the 6ft cable? the new cable is longer than it needs to be and I'm going to try a better shorter one.

One the plus side we've brewed 4 times now as we stock up for our opening and everything is working well as we dial in the system. (3bbl brews really ferment more aggressively)
 
BrunDog,
I did my first batch with BC today (in manual mode - still working on the script). One thing I experienced was during the boil, the pressure transducer (mounted under the kettle through the plywood desk) could not maintain a reasonable value. Over the course of the boil, it got progressively hotter and indicated (incorrectly) a decreasing volume. Now, I expected a piezo electric crystal to behave this way, only the magnitude of the decrease as a result of the heating was too much to make the transducer usable for me during the boil. I'm wondering if you have thoughts on how to address this? Have you tried a fan (I'm thinking this won't be enough) or circulating cool water in tubing around the sensor? Your thoughts are welcome. Thanks.
Why do you need to have an accurate volume reading during the boil?
 
Re: the diagram and things that are unconnected--there are a few signal lines that I did not delete from the wiring diagram (because I'm going to put them back), but I did disconnect everything from the "MEGA" in the diagram if it is not connected IRL.

Grounds: All of the AC grounds are tied together at the grounding post in the enclosure, to which is also tied the incoming ground from the 14-50 plug. All of my DC grounds are currently separate: the 12v GNDs go individually to a 12V power distribution block. The 5V SSR board's GND goes to the 5V PSU's GND. The 24V GND goes directly to the PSU (but when I add more 24V things, I have a terminal block for 24V (+) and GND). At present, only the 12v ground is connected to the AC ground.

All DC grounds should be tied together (at as close to one point as possible, for example one ground bus) - else the difference between 12V DC and 5V AC can't be assured. Whether or not the DC grounds are tied to the AC grounds is a personal choice, but in my experience reduces noise further.
 
BrunDog,
I did my first batch with BC today (in manual mode - still working on the script). One thing I experienced was during the boil, the pressure transducer (mounted under the kettle through the plywood desk) could not maintain a reasonable value. Over the course of the boil, it got progressively hotter and indicated (incorrectly) a decreasing volume. Now, I expected a piezo electric crystal to behave this way, only the magnitude of the decrease as a result of the heating was too much to make the transducer usable for me during the boil. I'm wondering if you have thoughts on how to address this? Have you tried a fan (I'm thinking this won't be enough) or circulating cool water in tubing around the sensor? Your thoughts are welcome. Thanks.

Is it the sensor we sell? Can you provide more specifics of the range change? Did it return to correct values once cooled?
 
So has anyone noticed if the original wiznet 5500 series of Ethernet shields seem to be sensitive to the length of cable? I have my second fermentation panel setup and working in the basement of the brewpub and everything was fine until I switched to a longer ethernet cable to move the router across the room and now I keep randomly losing communication which didnt happen with the 6ft cable? the new cable is longer than it needs to be and I'm going to try a better shorter one.

One the plus side we've brewed 4 times now as we stock up for our opening and everything is working well as we dial in the system. (3bbl brews really ferment more aggressively)

Maybe something isn't right with the cable in general, or perhaps the longer cable is more sensitive to noise pickup? I haven't experienced this myself, but can try to test it. How long is the cable? Did you make it yourself or is it pre-terminated.
 
All DC grounds should be tied together (at as close to one point as possible, for example one ground bus) - else the difference between 12V DC and 5V AC can't be assured. Whether or not the DC grounds are tied to the AC grounds is a personal choice, but in my experience reduces noise further.
Good to know. Should there just be a single PSU connected to the ground bus or should I connect my 24V and 5V PSUs to the ground bus as well?
 
Is it the sensor we sell? Can you provide more specifics of the range change? Did it return to correct values once cooled?

Yes, it's the sensor you sell. I'll do some tests with water today or tomorrow and report back the data. I'm pretty sure it came back to normal once cooled.
 
I've seen some acute creep (like ~15%), but then it settls a bit and its not enough to matter much. Boil volume is not critical, though I have thought about calculating real-time boil-off rates, and creep would not really allow that.
 
Yes, the bill off rate is one of the things I'd like to be able to do. Also, was going to fill the fermenters based on volume in the kettle but I think I can solve that.
 
You know... It would be cool if devices could have different images based on their state. Or one could do the same thing if we could change the image via script. I'm thinking of open and closed valves... Would make a sleeker workspace... Just a thought.
 
@phreaky : sorry for the delay. I just tested a Wemos D1 with Firmware v43 and it flashed properly, then I was able to communicate with it correctly to set up the network. I can shoot a video but it would be like the one on the website.

Are you sure you have the correct serial communication driver installed? On my computer, under Device Manager, I see 'USB-SERIAL CH340)' when the D1 is plugged in under Ports. The driver is 'CH341S64.sys'.

That is the driver I was using, and I tried reinstalling it several times, even downloaded it again from the wemos site. Still no change. Looks like it flashes ok, but no dice when configuring. For a test, I grabbed a different PC, and got it set up on there, and was able to flash the D1 mini version. The mini lite version failed in the same spot though. It flashes ok, but when opening the terminal, the only way to get any response from the device is to hit the reset button, and you get a line of gibberish. The %0&15; command does nothing. I would have to say the D1 mini lites will not work with the firmware for some reason.
 
Could I get a Script Review?

It works if I walk it through a mega and relayboard on my desk, but want a peer review before construction begins on new panel

Physical system is a 1000L Bain-Marie Jacketed still with electric heat, agitator, and a two pump and HX cooling fan units for reflux and product condensers.
BruControl is using a mega and relayboard controlling contactors and agitator(no PID or duty cycle) and stepping down power as it warms up (no hysteresis) and a couple SonOff Duals controlling the pumps and fans (actually in place now)

My experience is 10 years with BCS controlling homebrew rig and my first 100-gal still (I wanted to add 4-20mA and RTD) and recently with CBPi3(kinda worked) so that is why it is 'state machine'


Code:
new value StopTemp
new string CurrentState

StopTemp = 207
stop "CoolDownTimer"
reset "CoolDownTimer"


// Enable all devices needed
"9kW 0" Enabled = true
"9kW 1" Enabled = true
"9kW 2" Enabled = true
"9kW 3" Enabled = true
"Agitator" Enabled = true
"Bain Marie" Enabled = true
"Boiler Temp" Enabled = true
"Vapor Temp 1" Enabled = true
"Vapor Temp 2" Enabled = true
"PC Water IN" Enabled = true
"PC Water OUT" Enabled = true
"PC HX Return" Enabled = true
"RC Water IN" Enabled = true
"RC Water OUT" Enabled = true
"PC Pump" Enabled = true
"PC Fan" Enabled = true
"RC Pump" Enabled = true
"RC Fan" Enabled = true
"AlarmOut 1" Enabled = true
"Running" Enabled = true

// start the still run

[State0]
CurrentState = "Heat_36kW"
"Running" State = on
"9kW 0" State = on
sleep 1000     // pause before energizing another contactor
"9kW 1" State = on
sleep 1000     // pause before energizing another contactor
"9kW 2" State = on
sleep 1000     // pause before energizing another contactor
"9kW 3" State = on
"Agitator" State = on
goto State1

[State1]
if "Vapor Temp 1" Value >= 170 // exit to distilling state
 goto State6
endif
if "Bain Marie" Value >= 240 // exit to State2 when BM temp reaches 240 (~1 Bar)
 goto State2
endif
if "Bain Marie" Value >= 243 // shut off all heat if BM temp gets too high
 "Alarm 1" Active = true
 goto CoolDown
endif
goto State1

[State2]
CurrentState = "Heat_27kW"
"9kW 0" State = on
sleep 1000
"9kW 1" State = on
sleep 1000
"9kW 2" State = on
sleep 1000
"9kW 3" State = off
goto State3

[State3]
if "Vapor Temp 1" Value >= 170 // exit to distilling state
 goto State6
endif
if "Bain Marie" Value >= 241 // exit to State4 when BM temp reaches 241 (~1 Bar)
 goto State4
endif
if "Bain Marie" Value >= 243 // shut off all heat if BM temp gets too high
 "Alarm 1" Active = true
 goto CoolDown
endif
goto State3

[State4]
CurrentState = "Heat_18kW"
"9kW 0" State = on
sleep 1000
"9kW 1" State = on
"9kW 2" State = off
"9kW 3" State = off
goto State5

[State5]
if "Vapor Temp 1" Value >= 170 // exit to distilling state
 goto State3
endif
if "Bain Marie" Value >= 241 // exit to State1 when BM temp reaches 241 (~1 Bar)
 goto State6
endif
if "Bain Marie" Value >= 243 // shut off all heat if BM temp gets too high
 "Alarm 1" Active = true
 goto CoolDown
endif
goto State5

[State6]
CurrentState = "Distill"
"PC Pump" State = on
"PC Fan" State = on
"RC Pump" State = on
"RC Fan" State = on

if "Vapor Temp 1" Value >= StopTemp // exit to cooldown state
 goto CoolDown
endif
if "Bain Marie" Value >= 243 // shut off all heat if BM temp gets too high
 "Alarm 1" Active = true
 goto CoolDown
endif
goto State6

[CoolDown]
CurrentState = "CoolDown"
"9kW 0" State = off
"9kW 1" State = off
"9kW 2" State = off
"9kW 3" State = off
restart "CoolDownTimer"
wait "CoolDownTimer" Value > 00:05:00 // waits until the timer exceeds 5 minutes
"PC Pump" State = off
"PC Fan" State = off
"RC Pump" State = off
"RC Fan" State = off
"Agitator" State = off
"9kW 0" Enabled = false
"9kW 1" Enabled = false
"9kW 2" Enabled = false
"9kW 3" Enabled = false
"Agitator" Enabled = false
"PC Pump" Enabled = false
"PC Fan" Enabled = false
"RC Pump" Enabled = false
"RC Fan" Enabled = false
"AlarmOut 1" Enabled = false
"Running" Enabled = false

stop "Still Run Script"

upload_2018-11-27_12-42-56.png
 
phreaky said:
"So, I used the install tool to configure the network, but still no dice. It flashes the firmware and looks good, but when trying to config the network it just doesn't want to talk any more. Entering the %0&15; command produces no response from the ESP. Just to make sure I wasn't crazy, I used a D1 mini (not lite) that I have running another project, blanked it first, then uploaded the Brucontrol firmware and tried configuring the network on it. Same result, could not get any response from the terminal window when entering the config command."


I need to get this figured out as well for my MEGA 2560 as it is doing the exact same thing. The interesting thing is that it worked for a while and then I went back to do it again and Termite shows the same thing...nothing. I have tried it on two computers now and with TWO different ethernet shields (including one I got from BrunDog). Both times, nothing. No response. Man this is uber frustrating! I have tried basically every driver I can find and flashing always works but network setup just does nothing in termite and you end up with a device you cannot connect to as it doesn't get an IP.

Update. I have now tried this on three computers and Windows 10 and Windows 7. Still no response in Termite during network setup. If I do network setup with a firmware without ethernet capabilities, Termite does return "%0&23" and when the MEGA is flashed with an "E" capable firmware, no response. For some reason this does not feel like a driver issue but something in the firmware but that doesn't explain why it did work and now it doesn't and why it works for others.
 
Last edited:
That is the driver I was using, and I tried reinstalling it several times, even downloaded it again from the wemos site. Still no change. Looks like it flashes ok, but no dice when configuring. For a test, I grabbed a different PC, and got it set up on there, and was able to flash the D1 mini version. The mini lite version failed in the same spot though. It flashes ok, but when opening the terminal, the only way to get any response from the device is to hit the reset button, and you get a line of gibberish. The %0&15; command does nothing. I would have to say the D1 mini lites will not work with the firmware for some reason.

Sorry, I’m having a hard time following you. Is the regular D1 (non-lite) version working? Screen shots will help us see possibly where it’s not working. It doesn’t make much sense that the flashing sequence is working but then the terminal isn’t.
 
Could I get a Script Review?

It works if I walk it through a mega and relayboard on my desk, but want a peer review before construction begins on new panel

Physical system is a 1000L Bain-Marie Jacketed still with electric heat, agitator, and a two pump and HX cooling fan units for reflux and product condensers.
BruControl is using a mega and relayboard controlling contactors and agitator(no PID or duty cycle) and stepping down power as it warms up (no hysteresis) and a couple SonOff Duals controlling the pumps and fans (actually in place now)

My experience is 10 years with BCS controlling homebrew rig and my first 100-gal still (I wanted to add 4-20mA and RTD) and recently with CBPi3(kinda worked) so that is why it is 'state machine'


Code:
new value StopTemp
new string CurrentState

StopTemp = 207
stop "CoolDownTimer"
reset "CoolDownTimer"


// Enable all devices needed
"9kW 0" Enabled = true
"9kW 1" Enabled = true
"9kW 2" Enabled = true
"9kW 3" Enabled = true
"Agitator" Enabled = true
"Bain Marie" Enabled = true
"Boiler Temp" Enabled = true
"Vapor Temp 1" Enabled = true
"Vapor Temp 2" Enabled = true
"PC Water IN" Enabled = true
"PC Water OUT" Enabled = true
"PC HX Return" Enabled = true
"RC Water IN" Enabled = true
"RC Water OUT" Enabled = true
"PC Pump" Enabled = true
"PC Fan" Enabled = true
"RC Pump" Enabled = true
"RC Fan" Enabled = true
"AlarmOut 1" Enabled = true
"Running" Enabled = true

// start the still run

[State0]
CurrentState = "Heat_36kW"
"Running" State = on
"9kW 0" State = on
sleep 1000     // pause before energizing another contactor
"9kW 1" State = on
sleep 1000     // pause before energizing another contactor
"9kW 2" State = on
sleep 1000     // pause before energizing another contactor
"9kW 3" State = on
"Agitator" State = on
goto State1

[State1]
if "Vapor Temp 1" Value >= 170 // exit to distilling state
 goto State6
endif
if "Bain Marie" Value >= 240 // exit to State2 when BM temp reaches 240 (~1 Bar)
 goto State2
endif
if "Bain Marie" Value >= 243 // shut off all heat if BM temp gets too high
 "Alarm 1" Active = true
 goto CoolDown
endif
goto State1

[State2]
CurrentState = "Heat_27kW"
"9kW 0" State = on
sleep 1000
"9kW 1" State = on
sleep 1000
"9kW 2" State = on
sleep 1000
"9kW 3" State = off
goto State3

[State3]
if "Vapor Temp 1" Value >= 170 // exit to distilling state
 goto State6
endif
if "Bain Marie" Value >= 241 // exit to State4 when BM temp reaches 241 (~1 Bar)
 goto State4
endif
if "Bain Marie" Value >= 243 // shut off all heat if BM temp gets too high
 "Alarm 1" Active = true
 goto CoolDown
endif
goto State3

[State4]
CurrentState = "Heat_18kW"
"9kW 0" State = on
sleep 1000
"9kW 1" State = on
"9kW 2" State = off
"9kW 3" State = off
goto State5

[State5]
if "Vapor Temp 1" Value >= 170 // exit to distilling state
 goto State3
endif
if "Bain Marie" Value >= 241 // exit to State1 when BM temp reaches 241 (~1 Bar)
 goto State6
endif
if "Bain Marie" Value >= 243 // shut off all heat if BM temp gets too high
 "Alarm 1" Active = true
 goto CoolDown
endif
goto State5

[State6]
CurrentState = "Distill"
"PC Pump" State = on
"PC Fan" State = on
"RC Pump" State = on
"RC Fan" State = on

if "Vapor Temp 1" Value >= StopTemp // exit to cooldown state
 goto CoolDown
endif
if "Bain Marie" Value >= 243 // shut off all heat if BM temp gets too high
 "Alarm 1" Active = true
 goto CoolDown
endif
goto State6

[CoolDown]
CurrentState = "CoolDown"
"9kW 0" State = off
"9kW 1" State = off
"9kW 2" State = off
"9kW 3" State = off
restart "CoolDownTimer"
wait "CoolDownTimer" Value > 00:05:00 // waits until the timer exceeds 5 minutes
"PC Pump" State = off
"PC Fan" State = off
"RC Pump" State = off
"RC Fan" State = off
"Agitator" State = off
"9kW 0" Enabled = false
"9kW 1" Enabled = false
"9kW 2" Enabled = false
"9kW 3" Enabled = false
"Agitator" Enabled = false
"PC Pump" Enabled = false
"PC Fan" Enabled = false
"RC Pump" Enabled = false
"RC Fan" Enabled = false
"AlarmOut 1" Enabled = false
"Running" Enabled = false

stop "Still Run Script"

View attachment 599758

You don’t need a ‘goto’ when the next line is the one noted by the goto.

Also is see values getting evaluated which will not, such as in State 1... Bain Marie comparison > 243 will never be executed because the Vapor temp lines before it will since its comparison values are lower. Make sense?

I would eschew the idea of state machines ala BCS which duplicate code to make your script efficient. Create one loop that runs and calls sections depending on the section.
 
I can comment on my scenario which is with the MEGA 2560, with ethernet and RTD. The setup process involves running the "InterfaceSetup.bat" that is part of the BruControl firmware (v43). This opens the command window where you can install the firmware or proceed to network setup or exit (options 1, 2, and 3 respectively). In my case and from what I can tell, phreaky's case, we can both successfully install the firmware but once that is complete and you then go to network setup and properly select the com port and so on, the terminal opens. This terminal is the Termite program and when you issue the %0&15; instruction there is no response in the terminal window. In my case, I was able to get a responses at this point 3-4 times over a period of 8 hours while I played with different settings and static IP addresses. Since that time and while nothing changed on the computer connected via USB to the MEGA 2560, the terminal window stopped producing responses (i.e. no count down timer, etc.).

I have since reflashed the firmware numerous times on different computers, running different versions of windows, with various USB drivers all resulting in nothing but no response from the terminal window.

It is worth noting that when flashed with the "serial" version of the firmware and connected via the serial connection to the BruControl HMI computer, everything works fine. It is just that the ethernet shield cannot be setup due to the lack of any response from the controller as viewed in the terminal (termite).
 
phreaky said:
"So, I used the install tool to configure the network, but still no dice. It flashes the firmware and looks good, but when trying to config the network it just doesn't want to talk any more. Entering the %0&15; command produces no response from the ESP. Just to make sure I wasn't crazy, I used a D1 mini (not lite) that I have running another project, blanked it first, then uploaded the Brucontrol firmware and tried configuring the network on it. Same result, could not get any response from the terminal window when entering the config command."


I need to get this figured out as well for my MEGA 2560 as it is doing the exact same thing. The interesting thing is that it worked for a while and then I went back to do it again and Termite shows the same thing...nothing. I have tried it on two computers now and with TWO different ethernet shields (including one I got from BrunDog). Both times, nothing. No response. Man this is uber frustrating! I have tried basically every driver I can find and flashing always works but network setup just does nothing in termite and you end up with a device you cannot connect to as it doesn't get an IP.

Update. I have now tried this on three computers and Windows 10 and Windows 7. Still no response in Termite during network setup. If I do network setup with a firmware without ethernet capabilities, Termite does return "%0&23" and when the MEGA is flashed with an "E" capable firmware, no response. For some reason this does not feel like a driver issue but something in the firmware but that doesn't explain why it did work and now it doesn't and why it works for others.

Agree it is not a driver issue. Once you are able to flash the firmware, the driver is working fine.

When using the Ethernet shield, make sure it is properly seated, Ethernet cable is connected, lights are flashing indicating network traffic is identified. You can send just a semicolon and see if you get a response (will be &23). It is smart to wait after sending one (up to 20 seconds) in case the network is stuck initializing. Once you get a response, the config control code should work.

If you are having continued problems, we can try to do a Skype session and solve it remotely.
 
Agree it is not a driver issue. Once you are able to flash the firmware, the driver is working fine.

When using the Ethernet shield, make sure it is properly seated, Ethernet cable is connected, lights are flashing indicating network traffic is identified. You can send just a semicolon and see if you get a response (will be &23). It is smart to wait after sending one (up to 20 seconds) in case the network is stuck initializing. Once you get a response, the config control code should work.

If you are having continued problems, we can try to do a Skype session and solve it remotely.

I will play with it a bit more, give it more time and go from there. There is a confirmed link status on the shield and the switch it is connected to. There is activity indicated but after a while it goes to a pattern that indicates no data is being transfer (this is due to the shield being unconfigured and no IP being assigned as I see it). The router also does not report an assigned IP.
 
Sorry, I’m having a hard time following you. Is the regular D1 (non-lite) version working? Screen shots will help us see possibly where it’s not working. It doesn’t make much sense that the flashing sequence is working but then the terminal isn’t.
Correct.
PC 1: Mini flashes, but no network config. Mini Lite flashes, but no network config.
PC 2: Mini flashes, network config worked. Mini Lite flashes, but no network config.

I have used both PCs to flash a simple blink program to the Lite, and the led then blinks as programmed, so I know the computers are talking to it. I figured screen shots wouldn't be helpful, as all it shows is it not doing anything, so here is a video. This is the flashing and failure of the network config on the Mini Lite. We can also do a GoTo if you'd like.

 

Latest posts

Back
Top