Hey guys, I'm working on a pretty simple project (yes I'm a rookie), and I used some knowledge from my digital logic class to help me design my ladder logic, but I'm wondering if this made things more complicated.
I need to fill four chemical tanks, there is one pump that pumps the chemical to each tank at the same time. In line motorized valves allow the plc to divert the chemical to each tank. So in short I have 4 inputs, to indicate if the tank has reached a high level (T#). And 4 outputs to control the motorized valves (V#).
These tanks are just for storage, the intent is to fill tank 1, then tank 2, then tank, 3, then 4, back to tank 1. The tanks are emptied manually in no particular order.
So I made a truth table:
Tank ____Valve
4 3 2 1 | 4 3 2 1
-------------------
0 0 0 0 | 0 0 0 1
0 0 0 1 | 0 0 1 0
0 0 1 0 | 0 1 0 0
0 0 1 1 | 0 1 0 0
0 1 0 0 | 1 0 0 0
0 1 0 1 | 1 0 0 0
0 1 1 0 | 1 0 0 0
0 1 1 1 | 1 0 0 0
1 0 0 0 | 0 0 0 1
1 0 0 1 | 0 0 1 0
1 0 1 0 | 0 1 0 0
1 0 1 1 | 0 1 0 0
1 1 0 0 | 0 0 0 1
1 1 0 1 | 0 0 1 0
1 1 1 0 | 0 0 0 1
1 1 1 1 | 0 0 0 0
This table accounts for every state the tanks could be in as a result of not knowing what tank will get emptied.
From here I reduced my logic (yay karnaugh maps!) to:
T4T2'T1' + T3'T2'T1' + T4T3T1' = V1
T3'T2'T1 + T4T2'T1 = V2
T3'T2 = V3
T4'F3 = V4
Then I used corresponding contacts to trigger my coils in my ladder logic. I know this will do what I need it to, but I can't
help but think there is a simpiler way. I could probably use a sequencer, but at the same time using just contacts and coils
may make it easier for the next person to understand it.
I wonder if I could simplify my contacts even more (because this tank sequence seems like it should be simpler), but I can't picture in my mind what I really need, and what I possibly don't. Using the truth table allows me to picture in my mind what is going on, and what needs to be done.
So, to sum it up, how does everyone go about designing new logic? Where do you start? Using the truth table in my example, I'm very confident that I could
download it, and the system will work as intended. I know if I just sat, stared at my screen, programmed what I *think* is the correct
logic, that I would be debugging the system for a few hours until I was confident it was doing what I wanted. Hope I made some sense.
Just looking for some insight into your minds, how you all start to design/program your logic.
I need to fill four chemical tanks, there is one pump that pumps the chemical to each tank at the same time. In line motorized valves allow the plc to divert the chemical to each tank. So in short I have 4 inputs, to indicate if the tank has reached a high level (T#). And 4 outputs to control the motorized valves (V#).
These tanks are just for storage, the intent is to fill tank 1, then tank 2, then tank, 3, then 4, back to tank 1. The tanks are emptied manually in no particular order.
So I made a truth table:
Tank ____Valve
4 3 2 1 | 4 3 2 1
-------------------
0 0 0 0 | 0 0 0 1
0 0 0 1 | 0 0 1 0
0 0 1 0 | 0 1 0 0
0 0 1 1 | 0 1 0 0
0 1 0 0 | 1 0 0 0
0 1 0 1 | 1 0 0 0
0 1 1 0 | 1 0 0 0
0 1 1 1 | 1 0 0 0
1 0 0 0 | 0 0 0 1
1 0 0 1 | 0 0 1 0
1 0 1 0 | 0 1 0 0
1 0 1 1 | 0 1 0 0
1 1 0 0 | 0 0 0 1
1 1 0 1 | 0 0 1 0
1 1 1 0 | 0 0 0 1
1 1 1 1 | 0 0 0 0
This table accounts for every state the tanks could be in as a result of not knowing what tank will get emptied.
From here I reduced my logic (yay karnaugh maps!) to:
T4T2'T1' + T3'T2'T1' + T4T3T1' = V1
T3'T2'T1 + T4T2'T1 = V2
T3'T2 = V3
T4'F3 = V4
Then I used corresponding contacts to trigger my coils in my ladder logic. I know this will do what I need it to, but I can't
help but think there is a simpiler way. I could probably use a sequencer, but at the same time using just contacts and coils
may make it easier for the next person to understand it.
I wonder if I could simplify my contacts even more (because this tank sequence seems like it should be simpler), but I can't picture in my mind what I really need, and what I possibly don't. Using the truth table allows me to picture in my mind what is going on, and what needs to be done.
So, to sum it up, how does everyone go about designing new logic? Where do you start? Using the truth table in my example, I'm very confident that I could
download it, and the system will work as intended. I know if I just sat, stared at my screen, programmed what I *think* is the correct
logic, that I would be debugging the system for a few hours until I was confident it was doing what I wanted. Hope I made some sense.
Just looking for some insight into your minds, how you all start to design/program your logic.