truth tables...do you use them?

Terry, thanks for the response (edit - found my kmap mistake, thanks!). I appreciate everyone's response because I'm very much in the diaper phase of PLCs and anything I can pick up will only help me in the long run.

A little background, these 4 tanks are exisiting. Right now which tank gets filled is purely up to the system operator because the valves are all manual. We have just completed an addition to our facility, and new lines are being run from the new addition to fill these tanks as well. The exisitng lines from our existing facility are to remain manual, the new lines from the addition are going to be automated (these are the valves in my example).

I don't quite understand why we don't just have the PLC control everything from filling to drainig, but because I'm the new guy, I'm still being careful where I step. So I'm trying to work with what has been given too me.

I put the truth table together to try to lay out a path that would give me some direction as to how I could fill each tank in an equal manner, so that after 400 fill cycles, each tank will have been filled 100 times. I know it's probably not the simplest way of going about things.....but I need to learn......hence my consulting of this board to see if I'm even near the right tracks.

Adding analog level sensors, and drain valve sensors would be nice, but thats added cost which I'll have to justify. 4 level sensors, AI card, would add what a couple of grand to the project? I don't have a problem trying to justify the cost, but I'll have to prove that I cannot make the system operate without it.

Basically in my truth table I'm trying to accomplish something similiar to this:

Tank state
0000 All tanks empty
0001
0011
0111
1111 Alarm condition
1110<-+
1101 |
1011 |
0111 --+

But because I have no control over the drain, I have to account for every state the tanks could be in, and from there try to open the valves in an order that produces a similar result. So I may have three tanks filled at once, I may not, reguardless I need to make sure that the valve I open has a tank that is not full. Assuming that the system operator has done their job of draining the tanks when needed. See where I'm going?
 
Last edited:
The logic you've posted so far succeeds in prioritizing which tank is filled. If more than one tank is not full the lower numbered tank will be filled first. There is nothing in your logic to force the filling process to completely fill one tank before moving on to fill the next tank in order. If you're in the process of filling one tank and a lower numbered tank drains to the point where its sensor becomes true, then you're going to switch to filling the lower numbered tank.
 
Paully's5.0 said:
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.
I would simplify this. I would fill all tanks that aren't full at the same time.
This would effectively make the four tanks one big tank. Tanks that aren't full would equalize levels.
 
I see what you're saying Steve, that could be solved with a set coil fairly easily correct? Once the condition is met, latch the coil until that tank is completely full, then unlatch it.

edit- I'll put more thought into that, something doesn't seem right about that solution.
 
Last edited:
I would recommend you go waaaaay back to the beginning and look fairly closely at what Ron Beaufort posted. You could modify that fairly easily to do what you want.

The essence of Ron's solution is to abstract the selection of which tank to evaluate from the logic of which tank to fill. It really is just the basis of a sequencer.

However, I do kind of wonder why you have to go through the trouble. I'm with Peter. Just fill them all at the same time. Turn on the pump if any of the tanks are NOT full. Turn on a tanks valve if that tank is NOT full. Turn off the pump if all tanks are full.

Keith
 
In our original meeting about this addition to the system, the question was asked as to why not just treat the 4 tanks as "one" bulk storage tank, as suggested here. But the response basically was "this is hows it's been done, we don't want to change". Next time we meet I'll push the issue for some added i/o along with the "Why do we need to operate the system like this?" In the mean time, this example is just a first draft, I'll look at sequencers and Ron's example closer tomorrow and see what I can come up with.

Again, thats for the suggestions/guidence, sorry for making things so complicated!

kemenges- I grew up in the Oshkosh/Appelton area, not too far from your neck of the woods.
 
Originally posted by Paully's5.0:

kemenges- I grew up in the Oshkosh/Appelton area, not too far from your neck of the woods.

I live in Brillion and work in Neenah so I spend as much time in on the west side of the lake as the east side.

Keith
 
You may be interested in this,
http://www.controldraw.co.uk/Movies/Movies.htm
Look at the Cyclic Request Handler

Designed for a finite number of users of a resource, who request use of the resource via a boolean flag. They remove that flag when their demand no longer exists, that is when the requirement is over. The method guarantees First come at most Nth Served where N is the number of clients. But it avoids needing any form of queue and could easily be implemented in a PLC. .
 
I like to program like I talk. This keeps it simple and very easy for maintenance to understand the logic. Sometimes the ladder may get longer but that's okay ... usually.

I paraphased your logic and wrote a simple ladder to sequence thru it. See the attached word doc. I don't know an easier way to program it and still have it interpreted by any skill level.
 
wtmainjeff - My example is a bit different, it assumes that the request to be filled is more than just a low level. It might come from a phase requesting a fill for example but that hardly matters.
In your ladder what happens if the tank being filled gets taken out of service? In mine you would remove the Request Flag, then the others would get control. Mine also does not have to fill all the tanks in sequence, just those that request it.

In ladder I would just have a counter (say) which increments when a fill is not being performed, and then looks to see if Tank x (x is the counter value and should reset after it reaches the number of tanks) is requesting.
This is the code (VBS) behind the simulation. It could be done in Ladder easily.

dim Req(4)

dim Grant(4)

Req(1) = blnIn1

Req(2) = blnIn2

Req(3) = blnIn3

Req(4) = blnIn4

Grant(1) = blnOut1

Grant(2) = blnOut2

Grant(3) = blnOut3

Grant(4) = blnOut4

'TheValue = acquired state



If Req(TheValue) Then

' acquired and not released

Else

'release

Grant(TheValue) = False' Req(sngCount) Not Req(sngCount) '

sngCount = sngCount +1

if sngCount = 5 then sngCount = 1

TheValue = - Req(sngCount) * sngCount ' Grant(sngCount)

' Else

Grant(TheValue) = TheValue > 0

End If



blnOut1 = Grant(1)

blnOut2 = Grant(2)

blnOut3 = Grant(3)

blnOut4 = Grant(4)
 
Simply inserting a "Tank X in Bypass" OR'd with the tank's Memory Latch takes care of a tank in shutdown. You would obviously want to add auto and manual functions. Keeping it working as it 'always has' is sometimes in best interest unless dollar savings makes it worth changing.
 
I see I have more replies, thanks everyone! I haven't read them yet, I came up with some new logic that I think will do the trick. I want to post it before I become to influenced by everyone's suggestions. Trying to keep my brain chuggin along on its own!

I hope you can read the tags, I saved it as a jpeg to keep the file size down.

There is still a possible instance where the manual drain valve is open, indicating the tank is no longer at the high level, so the fill valve opens to fill that tank. I don't think filling and draining the tank at the same time will accomplish much! I think I can use this to justify added sensors on the drain valves to indicate the state (per Terry's sug.)

iTnk#Hlvl is the high level tank sensor, it's kind of hard to read it in the picture.

tankfill2.JPG
 
Last edited:

Similar Topics

Does anyone use these expressions or find them useful in the course of your work. I am taking a grad class with Industrial Systems Engineering...
Replies
5
Views
4,058
Hey all - I have made some pretty heavy edits to a very large Controllogix ACD, and added another ML1400. I'd like to feed my code into a piece of...
Replies
2
Views
2,162
Hey Guys, sure could use some help with truth table project, this is new to me, any help is appreciated. the project is this. I have 5 limit...
Replies
4
Views
2,615
With respect to motors controlled by a VFD Between O RPM and Baseline Torque "capacity" motor is equal to that of rated torque. Voltage is...
Replies
7
Views
3,108
1) is possible to manufacture 1747-CP13 cable with a simple cable category 5. if it is possible.. what the configuration of the pins
Replies
8
Views
2,775
Back
Top Bottom