Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Mechanical confusion - Inverting a Pressure Plate to close a hatch  (Read 1194 times)

WanderingKid

  • Bay Watcher
  • The Overfiend
    • View Profile

So, I'm trying to build something a little more elaborate than I usually do.  Here's the gist:  I want a pressure plate to CLOSE a hatch, not open it.

So, I've attached a lever to a series of hatches.  Flipped said lever to open state.  Once open, I then hooked up a plate to one of the hatches, and initiated it's trigger (in this case, a minecart).  It did not close the hatch.

Has anyone else needed to do this, and if so, how did you achieve having a plate trigger the opposite way (closing instead of opening on activation)?

Edit: Additional information.  Removing the trigger from the plate actually closes the hatch, even with the lever still attached, so that's not what's holding it open.

Imp

  • Bay Watcher
    • View Profile
Re: Mechanical confusion - Inverting a Pressure Plate to close a hatch
« Reply #1 on: August 06, 2013, 08:29:52 pm »

A clue that might help, or not.

A few versions ago I tried to 'control' how my levers appeared to me.  I had a fairly intricate system of multiple bridges, some of which I wanted to normally be open, some of which I wanted to be closed.

I decided that I wanted to place the levers I paid attention to in a few lines in the same area, and I wanted them all to have the same orientation when things were in the 'normal state' - so that open or closed, when the bridges were the way they 'normally' should be, all the levers would appear to be unused.

So I made a few extra levers in another place first, connected them to the bridges I wanted to normally be raised, and pulled them to raise the bridges, then connected the 'normal' levers, so these normal levers would control the bridges in reverse.

Sadly, I could not get the new levers to properly control my bridges as I wanted.  No matter if I left my original levers intact or not, the 'first' pull of a lever sends a close signal, and will not cause an already closed bridge to open.  The second pull of a lever sends an open signal, and will not cause an already opened bridge to close again.

I never found a way to do what you want done, but perhaps some extra elaborate method could make it happen.
Logged
For every trouble under the sun, there is an answer, or there is none.
If there is one, then seek until you find it.
If there is none, then never ever mind it.

TauRoku

  • Escaped Lunatic
    • View Profile
Re: Mechanical confusion - Inverting a Pressure Plate to close a hatch
« Reply #2 on: August 07, 2013, 01:48:44 am »

Unfortunately, in order to get your system working you need to do some engineering, either using fluid or mechanical logic. Rather than linking the pressure plate to the hatch, the plate should be linked to the device, and triggering the plate will cause the device to alter its state such that it will output the opposite signal to your hatch.

Here is the simplest fluid logic device:
http://dwarffortresswiki.org/index.php/Pressure_plate#Latching_Pressure_Plates

Link the hatch in the device to the pressure plate that your minecart will trigger. When the minecart hits the pressure plate, the hatch in the fluid logic device will open, dropping the water unto the device pressure plate below. Set the device pressure plate to trigger only with a range of water lower than what you will be using in the device. Doing this will cause the pressure plate to output a close signal when the water lands on the plate. By linking this plate to the hatch you want to close, you can get the hatch to close when the minecart hits the pressure plate.

Next, you need the device to reset. To do this, you need to link the pressure plate that the minecart will trigger to the gear assembly that powers the screw pumps. Thus, when the minecart triggers the plate, the gear assembly will disengage and the screw pumps will shut off. Once the minecart leaves the plate the gear assembly will engage, and the water will be pumped off the device plate and onto the hatch.

Finally, a useful thing to note: unlike all other buildings that can be linked to a lever or pressure plate, gear assemblies toggle. This means that if a gear assembly receives a signal from a linked trigger, it will always change states regardless of whether it is receiving an on or off signal.
Logged

WanderingKid

  • Bay Watcher
  • The Overfiend
    • View Profile
Re: Mechanical confusion - Inverting a Pressure Plate to close a hatch
« Reply #3 on: August 07, 2013, 02:11:58 am »

Yeah, I thought about using a fluid state control but that means I'd have to run power into an area I'd rather avoid trying to do so... and my FPS is suffering enough without firing up a DWR.  I suppose I could find some manipulative structure using the aquifer but it's WAY up there from the location I'm trying to work from.

Meh.  I've inverted the pathing logic but the general track is derailing itself that way on a U shaped drop and rise.  Ah well, I'll figure something out.  Thanks for the walkthrough, however.

Larix

  • Bay Watcher
    • View Profile
Re: Mechanical confusion - Inverting a Pressure Plate to close a hatch
« Reply #4 on: August 07, 2013, 03:34:04 am »

You can close your hatch by 'cycling' it: you send it a 'pulse' signal, e.g. from a pressure plate that your cart touches once and doesn't return to. Such signals by definition consist of an 'on' and a coupled 'off' coming ~100 steps after the cart left the plate. If you now delay your cart long enough, the hatch will be closed by the time the cart encounters it. The status of all other inputs to your target hatch doesn't matter, devices process any signal they receive, and triggers only send signals if their status changes - a lever sends signals the instant it is pulled, and no signals at all the rest of the time.

When you acquire a close signal from pressure plates, whether you go by cycling or by adding a logic 'NOT' gate, you'll always have to wait out the 100 steps activation time of 'off' signals in any case, unless you build ridiculous quick-close contraptions.

So, if you have a short-activation plate that only gets activated when you want the hatch to close, that does the same job as a complicated 'NOT' gate with alternative logic. The only benefit in the latter case is that it can turn a lasting 'on' input into a lasting 'off' output. If you have a short, 'intermittent' on, the off comes packaged with it, free of charge.
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Mechanical confusion - Inverting a Pressure Plate to close a hatch
« Reply #5 on: August 07, 2013, 06:36:36 am »

Well, the easiest to do this is through Dfhack magic, the power-meter can send an inverted signal:
https://github.com/peterix/dfhack#power-meter (Sorry for pasting this link into every single minecart thread. :) )

Also we discussed this problem with Suoli a while back, he came up with this idea to avoid the 100 tick reset delay:
http://www.bay12forums.com/smf/index.php?topic=127045.msg4312915#msg4312915

I did not go along this route, but I think it's worth investigating.

Larix

  • Bay Watcher
    • View Profile
Re: Mechanical confusion - Inverting a Pressure Plate to close a hatch
« Reply #6 on: August 07, 2013, 08:00:39 am »

Well, the easiest to do this is through Dfhack magic, the power-meter can send an inverted signal:
https://github.com/peterix/dfhack#power-meter

Since minecarts directly send signals when passing over pressure plates, that's still converting the signal to power and back to a signal instead of using the minecart itself to do the work. A short activation of a pressure plate does the job just fine, all that's needed is find a place in the architecture to place it. It's also possible to build entirely minecart-based NOT gates, but of course they have the same wait time built in before sending their 'off', on top of the longer latency.

Quote
Also we discussed this problem with Suoli a while back, he came up with this idea to avoid the 100 tick reset delay:
http://www.bay12forums.com/smf/index.php?topic=127045.msg4312915#msg4312915

I did not go along this route, but I think it's worth investigating.

This doesn't get you around the 100 step wait time after the initial signal, it's a recipe to build a 'flickering' door that spends much less than the 100 steps dictated by pressure plate logic in the 'open' position. It's quite useful for the management of contraptions like air locks (to minimise open time). For a quick closing of a building as immediate reaction to an activated pressure plate, i really can't think of a viable alternative to my brute-force approach of stacking up 22 'off' signals in a massive loop and using the 'on' trigger to kick out the cart preventing them from firing.
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Mechanical confusion - Inverting a Pressure Plate to close a hatch
« Reply #7 on: August 07, 2013, 08:20:20 am »

Of course it's possible to construct a pure minecart NOT gate, the advantage of this (if I'm right, have not tested with doors, only with gears) is that it will have an inverted signal from the beginning. So when it's off it will keep a door open, when receiving a signal from another pressure plate (via a gear) close immediately, and delay the next open signal by 100 ticks. Correction: it's 200 ticks, because this way two plates need to reset for the inverz signal.

And since gears have very little delay (or none at all?) this is fast, because there's no need for another minecart to trigger a secondary plate. Not usable for latching, or for quick-close-quick-open doors, but can be used for shifting the delay time. That you cannot do by vanilla components. At least not easily. Of course it's a hack/cheat...
« Last Edit: August 07, 2013, 08:42:40 am by fricy »
Logged

Merendel

  • Bay Watcher
    • View Profile
Re: Mechanical confusion - Inverting a Pressure Plate to close a hatch
« Reply #8 on: August 08, 2013, 10:23:39 pm »

Yeah, I thought about using a fluid state control but that means I'd have to run power into an area I'd rather avoid trying to do so... and my FPS is suffering enough without firing up a DWR.  I suppose I could find some manipulative structure using the aquifer but it's WAY up there from the location I'm trying to work from.
You can cause the aquifer flowing water bug to happen almost anywhere you want as long as you have access to a map edge or some other infinite drain (river, ocean, aquifer, cavern lake).   
Dig out a chamber. dig out a tunnel to the map edge from the chamber.  carve fortifications into map edge.   Place a door in the tunnel near the map edge linked to a lever.  Flood chamber and tunnel.   open door long enough to let some water flow to map edge then close it agian.   Top off your chamber, the chamber now has permanent flow pointing in the direction of the tunnel with no FPS hit.   I've been known to make excessivly large versions of this somewhere and just runing power lines to wherever if I need alot of power in different areas but you can make smaller ones on the spot.
Logged