I have plenty of basement space under the cell block, so space for wiring is not an issue. With regards to the button instead of lever placement, can one wire the circuits so that every press of the button changes the state of the door (i.e push 1: open, push 2: close, push 3: open etc)
Yes. It would likely involve JK flip flops on second thought, since those have a toggle state and can act like T flip flops while at the same time being able to be set/reset from other things.
The trouble with toggles in general is that they almost certainly have to be clocked or they'll cause wonky issues.
I like to use the button pulse itself as the clock for the flipflop but I'm not certain yet if that would be optimal when there's multiple possible pulse clocks.
In this case, the JK flip flop would act like a D Latch with edge-control via the Master Lock Lever and the Enforce Master button. Then it would act like a T flip flop in the case of that door's individual Lock button being pressed and triggering on that pulse.
Haha I'm in bed right now typing this up on my phone so I can't fiddle with any schematics on the computer, but I fiddled with some paperwork and I think it's certainly pretty feasible. I'll post tomorrow on it :3
I'm now reconcidering the setup after suggestion on a different forum. Currently I'm concidering this setup, on a control board:
Individual door switch + door opener + lockdown switch to AND gate
Lockdown switch + all door opener to another AND gate
Output of AND gates to OR gate
OR gate output to door.
This creates the following truth tables (I've put an inverter on the lockdown)
Individual Door control switch is A, door opener is B and lockdown is C:
A0, B0, C0 = Closed (lockdown in effect)
A1, B0, C0 = Closed (lockdown in effect)
A1, B1, C0 = Closed (lockdown in effect)
A1, B1, C1 = Open
A0, B1, C1 = Closed
A0, B0, C1 = Closed
On the other gate, D is master opener, C is lockdown, still inverted:
D0, C0 = Closed (lockdown in effect)
D1, C0 = Closed (lockdown in effect)
D1, C1 = Open
D0, C1 = Closed
The OR gate thus gives 1 out if A=1 AND B=1 AND C=1 |OR| C=1 AND D=1
This significantely makes the wiring a bit easier (Except that the three master switches will need several outputs). The setup allows the following:
On the control board, you select to open ex. cells 1, 2 and 4. You flick the switches for these cells, and then pull the OPEN switch. Doors 1, 2 and 4 open while 3 and 5 stay closed (I have 5 cells).
On the control board, you pull the lever to open all doors. All doors open.
On the control board, you decide to pull the lockdown switch. All open doors will close as a necessary input for both AND gates is set to 0.
This gives one lever to open select doors, one to open all doors, and one that will close all open doors and not allow any new doors to be opened until it is toggled again.
Ofc, this is easiest done with levers and not buttons. Any suggestions on how to incorporate buttons instead? Also, in a setup where you use buttons and latches, an interesting solution to reset the charge could be a pressure plate right on the inside of the door, auto-closing the open door as soon as someone enters the cell.
My current idea for button-usage puts an RS NOR Latch on the A input above, where S is button on control panel, and R either a master button (resetting all switches) or the mentioned pressure plate just inside the door. In any instance, toggling either the open switch or the lockdown switch will close the door.
Utilizing obsidian to build the cell walls later is also a thought I'm concidering, but I need to find more Obsidian first, as I believe my puny two stacks (legit mined!) doesn't cut it.
One Master Lock lever that, when enabled, will lock all the doors. When open, it does nothing.
X Door Control levers that, when enabled, will route the Open/Close-Selected Buttons to the corresponding doors.
One Open-Selected Button that will open each selected door.
One Close-Selected Button that will close each selected door.
X Individual Door Locks that, when pressed, will open or close the individual door on a toggle.
?
Pretty complex wiring. I did the earlier setup just in a logic gate diagram, and it's pretty impressive already. Want me to do this one, instead?
One Master Lock lever which will lock all doors and not allowing any new doors to be opened until toggled again
One Master Open lever which will open all doors, unless Master Lock is toggled.
X Individual Door Control buttons/levers that is required for selected door to open
One General Open lever that opens any door that has its Individiual Door Control activated. When toggled back, opened doors close.
Also as stated, I have 5 cells, so what I'm looking for is following (I just shorten the names above);
IDC1 through 5, linked through AND with GO and ML.
MO linked with ML in AND gate.
Output of both above through an OR.
I can probably figure this one out myself, if you have better things to do.
Add-on thought: If each IDC uses button and RS NOR latch, what if the output of GO inverted goes to the R? That would mean that as long as the GO (The GO need to be a button as well then, doesn't it?) is not activated, R on latch is 1. Wait, no, that wouldn't work. This means that you must toggle GO FIRST (so that R goes to 0, and you must use a lever), and THEN do the IDC's.
So, do you want your General Open Lever to simply set the state of each door to be equal to itself as long as that's one of the selected doors?
So that if your General Open Lever is ON, and you select with the selection levers door 1, 3, and then 5, then door 1, 3, and then 5 will open?
And then if you turn those levers off and then turn on the lever for door 2, then door 2 will open?
And then if you turn on the lever for door 5, nothing happens, and then you turn the General Open Lever to off and door 2 and door 5 will open?
This is all assuming that the Master Lock is off and the Master Open is off.
You'll have to have a J K Flip-Flip attached to each door, with a button at that door as that individual door's toggle.
Also, you'll have to make sure that the General Open lever and associated connections supercede the individual toggles; that is, if a door is flagged to be "closed" by the General Open lever (ie that door's selection lever is enabled and the General Open lever is at "close") then pressing the button that would normally toggle the door won't do anything.
Yes?
Although if you just give each door its own individual lever, instead, then it's just a matter of priorities:
If the Master Lock is on, the door is closed
Otherwise, if the Master Open is on, the door is open
Otherwise, if the door's selector control lever is on, the door is open/closed based on the state of the General Lever
Otherwise, if the door's individual lever is on, the door is open.
Truth Table
ML : Master Lock
MO : Master Open
CL : Control Lever
GL : General Lever
IL : Individual Lever
ML MO CL GL IL Door
1 x x x x Closed
0 1 x x x Open
0 0 1 0 x Closed
0 0 1 1 x Open
0 0 0 x 0 Closed
0 0 0 x 1 Open
We can write this as a Sum-of-Products, or a Product-of-Sums. Since the door is powered when it's locked, let's take a look:
SoP: ML + (ML)'(MO)'(CL)(GL)' + (ML)'(MO)'(CL)'(IL)'
PoS: (ML + (MO)') (ML + MO + (CL)' + (GL)') (ML + MO + CL + (IL)')
Let's go with the SoP, since it's simpler.
We'll call the terms A, B, C, D, E in that order, instead, to make it easier to read:
A + A'B'CD' + A'B'C'E'
= A + A'(B'CD' + B'C'E') ~ factored out A'
= A + B'CD' + B'C'E' ~ used rule A + A'(? + ?) = A + ? + ?
= A + B'(CD' + C'E') ~ factored out B'
My boolean algebra's a bit rusty, so I think that's about as far as I can get with this. So you're looking at the door being connected to an OR gate. That gate is connected to the Master Lock, and to another circuit. That second circuit is an AND gate connecting the Master Open switch (to an inverter) and yet another circuit. That third circuit is an OR gate connected two circuits: First, the General Lever connected to an inverted Control Lever via AND; and second, the inverted General Lever connected to the inverted Individual Lever.
How it works:
All of the one door switches move to the door as normal.
I also added the idea from LeoKhenir. If you don't want it, just remove the not gate, and gate, and the lockdown switch and wiring for that. For the all open and lockdown, there is a not gate (Inverter) on the lockdown, and then an AND gate. Here was the complicated part, you had to put the output of the AND gate into each door wire. So what I did was make a NOT gate.
and so the out put of the one door at a time switch didn't go into the all open thing and open all doors, I added a NOT gate connected to the wire, so it converts it back to the normal signal, and then made a small bridge over the wire. I did this once more, then I made a repeater because the wire length ran out, then I made another NOT gate on to the door opening wire, and one more bridge, and another NOT gate. I hope this is what you wanted.
Edit: I was tired last night, I made a mistake, at least it works for the op.
Rollback Post to RevisionRollBack
Damn you forum only allowing two lines in the signature.
- Thank you slimes.
taggedjc: I've decided to cut away the individual door levers from your setup, so there are no levers "locally". All is controlled from a remote switch board.
Thus, I'm left with my own setup of a Master Lock, a Master Open, Individual Control and General Open. I'm running for that setup, with IC, GO and ML connected through an AND gate, and MO and ML connected through another AND gate, with the AND outputs going to input on a OR gate. I'm currently simplifying it with only levers for control switches, although a General Close button can be arranged on the control board to send an R signal to a RS NOR latch where the IC is S and Q from that latch goes to the AND gate for individual control. Currently viewing this as easiest setup.
Here's a basic diagram I made with my awesum MSPaint skills in 5 minutes:
This gives me the following truth table, and there's a not drawed inverter on the MC (state in truth table is before inverter):
IDCx=0, GO=0, MC=0 - Close
IDCx=1, GO=0, MC=0 - Close
IDCx=1, GO=1, MC=0 - Open door x
IDCx=1, GO=1, MC=1 - Close (lockdown)
IDCx=0, GO=1, MC=1 - Close (lockdown)
IDCx=0, GO=0, MC=1 - Close (lockdown)
MO=0, MC=0 - Close
MO=1, MC=0 - Open all
MO=1, MC=1 - Close (lockdown)
MO=0, MC=1 - Close (lockdown)
The IDCx output from above is after the RS NOR latch. GC is the R on every latch, thus the button required to change state on IDCx from 1 to 0.
The trouble with toggles in general is that they almost certainly have to be clocked or they'll cause wonky issues.
I like to use the button pulse itself as the clock for the flipflop but I'm not certain yet if that would be optimal when there's multiple possible pulse clocks.
In this case, the JK flip flop would act like a D Latch with edge-control via the Master Lock Lever and the Enforce Master button. Then it would act like a T flip flop in the case of that door's individual Lock button being pressed and triggering on that pulse.
Haha I'm in bed right now typing this up on my phone so I can't fiddle with any schematics on the computer, but I fiddled with some paperwork and I think it's certainly pretty feasible. I'll post tomorrow on it :3
Individual door switch + door opener + lockdown switch to AND gate
Lockdown switch + all door opener to another AND gate
Output of AND gates to OR gate
OR gate output to door.
This creates the following truth tables (I've put an inverter on the lockdown)
Individual Door control switch is A, door opener is B and lockdown is C:
A0, B0, C0 = Closed (lockdown in effect)
A1, B0, C0 = Closed (lockdown in effect)
A1, B1, C0 = Closed (lockdown in effect)
A1, B1, C1 = Open
A0, B1, C1 = Closed
A0, B0, C1 = Closed
On the other gate, D is master opener, C is lockdown, still inverted:
D0, C0 = Closed (lockdown in effect)
D1, C0 = Closed (lockdown in effect)
D1, C1 = Open
D0, C1 = Closed
The OR gate thus gives 1 out if A=1 AND B=1 AND C=1 |OR| C=1 AND D=1
This significantely makes the wiring a bit easier (Except that the three master switches will need several outputs). The setup allows the following:
On the control board, you select to open ex. cells 1, 2 and 4. You flick the switches for these cells, and then pull the OPEN switch. Doors 1, 2 and 4 open while 3 and 5 stay closed (I have 5 cells).
On the control board, you pull the lever to open all doors. All doors open.
On the control board, you decide to pull the lockdown switch. All open doors will close as a necessary input for both AND gates is set to 0.
This gives one lever to open select doors, one to open all doors, and one that will close all open doors and not allow any new doors to be opened until it is toggled again.
Ofc, this is easiest done with levers and not buttons. Any suggestions on how to incorporate buttons instead? Also, in a setup where you use buttons and latches, an interesting solution to reset the charge could be a pressure plate right on the inside of the door, auto-closing the open door as soon as someone enters the cell.
My current idea for button-usage puts an RS NOR Latch on the A input above, where S is button on control panel, and R either a master button (resetting all switches) or the mentioned pressure plate just inside the door. In any instance, toggling either the open switch or the lockdown switch will close the door.
Utilizing obsidian to build the cell walls later is also a thought I'm concidering, but I need to find more Obsidian first, as I believe my puny two stacks (legit mined!) doesn't cut it.
One Master Lock lever that, when enabled, will lock all the doors. When open, it does nothing.
X Door Control levers that, when enabled, will route the Open/Close-Selected Buttons to the corresponding doors.
One Open-Selected Button that will open each selected door.
One Close-Selected Button that will close each selected door.
X Individual Door Locks that, when pressed, will open or close the individual door on a toggle.
?
Pretty complex wiring. I did the earlier setup just in a logic gate diagram, and it's pretty impressive already. Want me to do this one, instead?
One Master Lock lever which will lock all doors and not allowing any new doors to be opened until toggled again
One Master Open lever which will open all doors, unless Master Lock is toggled.
X Individual Door Control buttons/levers that is required for selected door to open
One General Open lever that opens any door that has its Individiual Door Control activated. When toggled back, opened doors close.
Also as stated, I have 5 cells, so what I'm looking for is following (I just shorten the names above);
IDC1 through 5, linked through AND with GO and ML.
MO linked with ML in AND gate.
Output of both above through an OR.
I can probably figure this one out myself, if you have better things to do.
Add-on thought: If each IDC uses button and RS NOR latch, what if the output of GO inverted goes to the R? That would mean that as long as the GO (The GO need to be a button as well then, doesn't it?) is not activated, R on latch is 1. Wait, no, that wouldn't work. This means that you must toggle GO FIRST (so that R goes to 0, and you must use a lever), and THEN do the IDC's.
It's a bit easier than your plan above, innit?
So that if your General Open Lever is ON, and you select with the selection levers door 1, 3, and then 5, then door 1, 3, and then 5 will open?
And then if you turn those levers off and then turn on the lever for door 2, then door 2 will open?
And then if you turn on the lever for door 5, nothing happens, and then you turn the General Open Lever to off and door 2 and door 5 will open?
This is all assuming that the Master Lock is off and the Master Open is off.
You'll have to have a J K Flip-Flip attached to each door, with a button at that door as that individual door's toggle.
Also, you'll have to make sure that the General Open lever and associated connections supercede the individual toggles; that is, if a door is flagged to be "closed" by the General Open lever (ie that door's selection lever is enabled and the General Open lever is at "close") then pressing the button that would normally toggle the door won't do anything.
Yes?
Although if you just give each door its own individual lever, instead, then it's just a matter of priorities:
If the Master Lock is on, the door is closed
Otherwise, if the Master Open is on, the door is open
Otherwise, if the door's selector control lever is on, the door is open/closed based on the state of the General Lever
Otherwise, if the door's individual lever is on, the door is open.
We can write this as a Sum-of-Products, or a Product-of-Sums. Since the door is powered when it's locked, let's take a look:
SoP: ML + (ML)'(MO)'(CL)(GL)' + (ML)'(MO)'(CL)'(IL)'
PoS: (ML + (MO)') (ML + MO + (CL)' + (GL)') (ML + MO + CL + (IL)')
Let's go with the SoP, since it's simpler.
We'll call the terms A, B, C, D, E in that order, instead, to make it easier to read:
A + A'B'CD' + A'B'C'E'
= A + A'(B'CD' + B'C'E') ~ factored out A'
= A + B'CD' + B'C'E' ~ used rule A + A'(? + ?) = A + ? + ?
= A + B'(CD' + C'E') ~ factored out B'
My boolean algebra's a bit rusty, so I think that's about as far as I can get with this. So you're looking at the door being connected to an OR gate. That gate is connected to the Master Lock, and to another circuit. That second circuit is an AND gate connecting the Master Open switch (to an inverter) and yet another circuit. That third circuit is an OR gate connected two circuits: First, the General Lever connected to an inverted Control Lever via AND; and second, the inverted General Lever connected to the inverted Individual Lever.
XD
Phew.
How it works:
All of the one door switches move to the door as normal.
I also added the idea from LeoKhenir. If you don't want it, just remove the not gate, and gate, and the lockdown switch and wiring for that. For the all open and lockdown, there is a not gate (Inverter) on the lockdown, and then an AND gate. Here was the complicated part, you had to put the output of the AND gate into each door wire. So what I did was make a NOT gate.
and so the out put of the one door at a time switch didn't go into the all open thing and open all doors, I added a NOT gate connected to the wire, so it converts it back to the normal signal, and then made a small bridge over the wire. I did this once more, then I made a repeater because the wire length ran out, then I made another NOT gate on to the door opening wire, and one more bridge, and another NOT gate. I hope this is what you wanted.
Edit: I was tired last night, I made a mistake, at least it works for the op.
Damn you forum only allowing two lines in the signature.
- Thank you slimes.
Thus, I'm left with my own setup of a Master Lock, a Master Open, Individual Control and General Open. I'm running for that setup, with IC, GO and ML connected through an AND gate, and MO and ML connected through another AND gate, with the AND outputs going to input on a OR gate. I'm currently simplifying it with only levers for control switches, although a General Close button can be arranged on the control board to send an R signal to a RS NOR latch where the IC is S and Q from that latch goes to the AND gate for individual control. Currently viewing this as easiest setup.
Here's a basic diagram I made with my awesum MSPaint skills in 5 minutes:
This gives me the following truth table, and there's a not drawed inverter on the MC (state in truth table is before inverter):
IDCx=0, GO=0, MC=0 - Close
IDCx=1, GO=0, MC=0 - Close
IDCx=1, GO=1, MC=0 - Open door x
IDCx=1, GO=1, MC=1 - Close (lockdown)
IDCx=0, GO=1, MC=1 - Close (lockdown)
IDCx=0, GO=0, MC=1 - Close (lockdown)
MO=0, MC=0 - Close
MO=1, MC=0 - Open all
MO=1, MC=1 - Close (lockdown)
MO=0, MC=1 - Close (lockdown)
The IDCx output from above is after the RS NOR latch. GC is the R on every latch, thus the button required to change state on IDCx from 1 to 0.