Reverse Timing using redstone
I am looking to reverse the timing of redstone for an airlock system I'm building. I have tried using ABBA and ABAB switches, but to no avail. I would like it to work as follows;
-- Stage 1 --
Inside door is closed
Water side door is open
Close water side door
Wait X ticks (repeater configurable) for water to drain
Open inside door
-- Stage 2 --
Inside door is open
Water side door is closed
Close inside door
Open water side door
As you can see, I only want timing in one direction (when the power is coming on, or going off), and I'm not completely sure how to go about doing this. Any tips would be welcomed.
Solution 1:
You were on the right track with an ABBA circuit, as one can be easily modified to do what you want as shown here.
The square of blocks and repeaters on the left is a common ABBA circuit that connects to the doors of the airlock from the blocks in the middle.
The line of repeaters circling around to connect the two blocks that power the doors are what add the ability to extend significantly extend the timing on one phase of the door cycle to allow time for the water to disappear.
In this particular example the block at the top of the image with the redstone torch controls the inside of the airlock and the block at the bottom with the redstone dust controls the outside.
The system is currently in the inside open state. When the lever is flipped it will close the inside doors and a 2 ticks later open the outside doors. The opening of the outside doors will power the additional redstone line.
When the lever is flipped again the system will close the outside doors and then attempt to open the inside doors which will instead be held closed by the additional delay line long enough for the water to clear.
Solution 2:
Use RS latches to control each door. These have a SET
and RESET
input.
Assuming you want control from just a lever, you need a rising edge detector and a falling edge detector on the output from the lever. These will only trigger when the lever is switched on or off respectively.
Then simply hook these up to the relevant SET
and RESET
inputs on the RS NOR latches, with the appropriate delays.
Solution 3:
Here is an alternative solution using good ol' minecarts!
Everything is visible except for the single booster rail below the cart.
You can use a different T-Flip-Flop if you want to, but i think these are pretty cool. I have no idea where i got the design (couldn't find it again :/) so here's a detail of one:
Just throw a single item into the hopper and it should work.
I hope this helps!
Solution 4:
I have based my design on @fredley's idea. It uses 2 rising edge detectors and 2 falling edge detectors (of my own design), along with 2 RS-NOR latches. I have hooked it up as suggested, and my design looks like this;
The red and yellow sections are both RS-NOR latches, and the long lines of repeaters (far left on red, far right on yellow) can be configured to modify door timings.
The light blue sections on both sides are identical, and are 1 tick pulse generators that I use as my edge detectors.
The dark blue section in the center simply sorts out the inverted signals for the pulse generators to use.
The dark green circuit is simply a T-Flip Flop, and the light green section is simply a configurable clock for testing the circuit.