Ladder Logic Label, Tags, Descriptions

Describe your system and processes, and post your config file.
User avatar
ballz50401
Posts: 13
Joined: Thu Feb 21, 2013 11:02 pm
Bot?: No

Ladder Logic Label, Tags, Descriptions

Post by ballz50401 »

Would it be possible to be able to add rung comments and name the inputs/outputs associated with the program. It would make programming and troubleshooting ladder logic much easier. Also if you could toggle the inputs on and off for testing purposes. Thanks!
User avatar
ballz50401
Posts: 13
Joined: Thu Feb 21, 2013 11:02 pm
Bot?: No

Re: Ladder Logic Label, Tags, Descriptions

Post by ballz50401 »

It would be nice to select an option to have Ladder Logic take priority over Process Programming. I wanted to use Ladder Logic to switch my heating element contactor on or off depending on the state of my lower float switch to prevent it from running dry. The rung was true with an open contact in the rung because a process was turning it on. I'll be using 7 float switches to control my heating elements, pump, and motorized valve so having this option would make my programming more flexible.
User avatar
ballz50401
Posts: 13
Joined: Thu Feb 21, 2013 11:02 pm
Bot?: No

Re: Ladder Logic Label, Tags, Descriptions

Post by ballz50401 »

Ok...now I'm confused. My PROCESS STATE programming has priority over my LADDER LOGIC programming, but my LADDER LOGIC programming has priority over MANUAL MODE. I finished all of my process state and ladder logic programming Everything was working how it should. Now when I try to manually assert outputs 6-17 they will not turn on unless I remove that output from my ladder logic. Outputs 0-5 seem to work though. Someone please help.
Attachments
Ladder Logic.png
Ladder Logic.png (58.43 KiB) Viewed 10284 times
User avatar
ballz50401
Posts: 13
Joined: Thu Feb 21, 2013 11:02 pm
Bot?: No

Re: Ladder Logic Label, Tags, Descriptions

Post by ballz50401 »

Here is my Manual Mode.
Attachments
BCS Control System from Embedded Control Concepts.png
BCS Control System from Embedded Control Concepts.png (46.87 KiB) Viewed 10284 times
User avatar
cscade
Posts: 49
Joined: Wed Sep 16, 2009 1:54 pm
Bot?: No

Re: Ladder Logic Label, Tags, Descriptions

Post by cscade »

To simplify, this is a case of output contention. The BCS provides two methods to control outputs; Process control (including manual mode), and Ladder logic. The system is not designed to have both methods attached to the same outputs at the same time, and doing so will cause undefined behavior.

The vast majority of the time, Ladder Logic will "win", if a process (including Manual) is also attempting to control the same output. From the wiki: "[For Ladder Logic,] The priority is oldest rung first (highest number), and Ladder Logic takes priority over Processes."

It is possible to create situations where a process "wins" over Ladder Logic, but this is undefined behavior - meaning you can't count on it being reliable.

To work around these issues, you will need to go "back to the drawing board" so to speak, and rethink your control logic to separate concerns between ladder logic and process control. Looking at your ladder logic screenshot, you have a lot going on there that would likely be better suited as part of a process.

From a design standpoint, it helps to think of ladder logic as "always on", so use it for things that need to happen outside of process control. Think of processes as linear steps of work to perform, and use them as much as possible.
User avatar
ballz50401
Posts: 13
Joined: Thu Feb 21, 2013 11:02 pm
Bot?: No

Re: Ladder Logic Label, Tags, Descriptions

Post by ballz50401 »

Thanks for your reply. What you said makes sense. I've been trying to find the best way to program my system and thought I had it until I tried running my outputs in manual mode. I think I might be able use the process programming option "Registers Asserted in this State" and use certain registers to allow rungs to be true. Still trying to find the best way to program. I've had some experience with Allen Bradley Control Logix programming so I prefer ladder logic over process programming, but trying to use both is proven to be difficult.
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: Ladder Logic Label, Tags, Descriptions

Post by JonW »

ballz50401 - why so many registers in your programming?

If you give me an overview of what your brewing workflow is, I can probably give you some pointers on using processes to accomplish it. For my own system, I use 5 processes on brew day, but I only start 1 process manually. The rest are automatically chained together and started by time/temp/triggers of other processes.
User avatar
ballz50401
Posts: 13
Joined: Thu Feb 21, 2013 11:02 pm
Bot?: No

Re: Ladder Logic Label, Tags, Descriptions

Post by ballz50401 »

Just a little backround info...I've decided to go back to school for Electromechanical Systems Technology and convinced my instructor to let me design and build my own eHERMS brewing setup for my senior project. I have drawn all of my process flow charts on autocad and the descriptions below are my goals for each process. I believe my programming should work the way I currently have it, but things can and will change once everything is wired up. I'll try to post some pics of my setup...

Heating Strike Water
The Hot Liquor Tank will be manually filled with water above the top of the Heat Exchange Coil. The Mash Tun will be manually filled with water to the appropriate level according to the recipe being brewed. The MT Upper Float Switch will be adjusted to match this desired level. Water from the MT will flow to the inlet of the Pump where it will be pumped through the HEX and then flow to the inlet of the MT. Water in the HLT will be heated by the heating element until the recipe mash temperature is reached. An alarm buzzer will sound when the setpoint temperature is reached, but will continue to recirculate while maintaining the setpoint.
· The Pump will not run if the MT Lower Float Switch is open to prevent it from running dry.
· The HLT Heating Element will not run if the HLT Lower Float Switch is open to prevent it from running dry.

Recirculating Mash
The Wort will flow through the Mash Tun Out into the Pump In. The Pump Out will flow the the HEX In. The HEX Out will flow to the MT In. Flow will be controlled by manually adjusting the Pump Out valve. MT wort level will be maintained by opening/closing the MT In Motorized Ball Valve from input from the MT Upper Float Switch. Mash wort will continue to recirculate through the system while maintaining the desired temperature setpoint for a set amount of time. When the Mash timer is done, the temperature setpoint will be raised to Mashout temperature. An alarm buzzer will sound when this temperature is reached. System will remain running while maintaining the temperature setpoint until manually stopped.

· The Pump will not run if the MT Lower Float Switch is open to prevent it from running dry..
· The HLT Heating Element will not run if the HLT Lower Float Switch is open to prevent it from running dry.

Sparging Mash
· The Heat Exchanger In connection will be switched to the Boil Kettle In.
· The HEX Out connection will be switched to the Mash Tun In.

The flow from the Hot Liquor Tank Out will be manually adjusted to match the flow rate of the MT Out. The Motorized Ball Valve will assist in maintaining the desired level in the MT by open/closing when the MT Upper Float Switch closes/opens. Sweet Wort will flow through the MT Out through the Pump and through the Boil Kettle In. HLT water will maintain set mashout temperature while sparging. BK Upper Float Switch will be adjusted to desired level determined by recipe. Sparging will continue until desired BK level is reached. When sparging is finished the HLT Heating Element will not run, the Pump will shut off, and the Motorized Ball Valve will close. The Sweet Wort will then be heated by the BK Heating Element until the desired temperature is reached. An alarm buzzer will sound while maintaining this set temperature. The system will now be ready to run in Manual Mode and the Boiling of the Sweet Wort can start.

· The Pump will not run if the MT Lower Float Switch is open to prevent it from running dry.
· The Motorized Ball Valve will close if the MT Upper Float Switch is open to prevent the desired level to become too high.
· The Motorized Ball Valve will open if the MT Upper Float Switch is closed to prevent the desired level to become too low.
· The HLT Heating Element will not run if the HLT Lower Float Switch is open to prevent it from running dry.
· The BK Heating Element will not run if the BK Lower Float Switch is open to prevent it from running dry.

Boil & Chilling
· The Boil Kettle In will remain the same.
· The Mash Out connection will be switched to Boil Out.

The Boil will be controlled manually through the controller. Output intensity will be set with a PWM percentage. The Plate Chiller will be sanitized by pumping +170F liquid through it for at least 10 minutes during or after the boil. When the Boil is finished the wort will be pumped through the Plate Chiller and then to the fementer. The desired chilled wort temperature will depend on the recipe (Ales - 65F / Lagers - 50F).

· All Outputs will be run in Manual Mode.
User avatar
ballz50401
Posts: 13
Joined: Thu Feb 21, 2013 11:02 pm
Bot?: No

Re: Ladder Logic Label, Tags, Descriptions

Post by ballz50401 »

I'm using alot of registers for my double float switches to control my floating motorized ball valve (w/ PWM output) to control sparge water flow during lautering. Here's a screen shot of my registers:
Attachments
Process Setup for BCS Control System.png
Process Setup for BCS Control System.png (25.44 KiB) Viewed 10226 times
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: Ladder Logic Label, Tags, Descriptions

Post by JonW »

(Ballz50401 - I've moved this topic to the "BCS Programming" sub-forum since it's really more related to that than a feature request.)

Wow, wish I could have built a brew system as a senior project!

At the moment I'm strapped for time and can't give you as detailed an answer as I would like (hopefully tonight), but what you've described is very doable and can be simplified a bit using more processes and states. You haven't outlined what existing processes/states you're trying to fit this into, so I'll just give you a screen shot of mine and a quick overview so you can see what's going on. I think this might help you with seeing where you can put yours into the Process/State type framework.

I use 5 processes for a brew day. One handles the MLT heat/hold/recirc/mash-out function, one for HLT heat/hold, one for fly sparging, one for the boil process and one that tracks hop additions. I only start the MLT process at the beginning of the brew day and all other processes are triggered to fire automatically. e.g. When the strike water gets to temp, my process moves from "Heat Strike" to "Hold Strike Temp" which triggers the alarm and fires off the HLT process to get the sparge water ready. At the end of my mash timer, it then triggers the alarm and fly sparge process (which also shuts down the MLT & HLT processes). Part way through the fly sparge process, it moves from "HLT/MLT Active" to "HLT/MLT/BK Active" which triggers the boil process to start heating (and alarm again). Once the BK reaches boil temp, it triggers the "Boil Timer Start" state which also kicks off the "Hop Additions" process. (FYI - the initialize proc state (State 0) is used to start timers and open valves for purging prior to firing the pump and allows jumping back to other states if need be without having to reset overall timers).

Yes, processes can be done with fewer states, but the way I have it set up, a change in state is used to trigger alarms and other processes, so it makes the complete brew day an automated process with no manual control. I see yours being very similar, but with the addition of the float switches as additional triggers to change states for enabling/disabling heating, valves or pumps). Also, you wouldn't always need to change a state with your float switches, you can just have them disable outputs via the ladder logic.

Take a look at this layout of processes/states and see if it helps at all.
BCS-Desktop.png
BCS-Desktop.png (213.95 KiB) Viewed 10215 times
Post Reply