v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

User:bjh21/Dwarven block signalling

From Dwarf Fortress Wiki
Jump to navigation Jump to search
This page is not yet finished. What's already here probably works, though.

Minecarts are great, but things go wrong when they collide. This page presents a signalling system for minecarts that should stop them colliding.

The block concept[edit]

The critical concept is a block, which is a length of track that should contain at most one minecart at any time. The job of the signalling system is to ensure that this is always true.

Blocks are delimited by pressure plates that are set to detect minecarts. A block can in principle have multiple entrances and multiple exits, but a single pressure plate can't be both an entrance and an exit for the same block.

Signals are used to control minecarts. A signal that can prevent a minecart from entering a block is said to protect the block and is an entrance signal for that block. A signal that can prevent a minecart from leaving a block is called an exit signal for that block. Any given signal will usually be an exit signal for one block and an entrance signal for the next block.

Standard components[edit]

A standard signal is constructed from a power source (shown as P), two rollers, a gear assembly, and a pressure plate arranged like this:

P
^

The track runs continuously under the signal from left to right. The left roller drives to the right constantly. When the gear assembly is engaged, it will cause the right roller to drive the minecart back to the left. This means that the minecart stays at the signal but never stops moving, which ensures that dwarves don't decide that it's finished its journey. When the block ahead is clear, the gear assembly disengages and the minecart can continue. The pressure plate is set to detect all minecarts.

Each block also has a fluid S/R latch to record whether there's a minecart in it. The latch should have levers for manual control of its inputs.

ò
^ ò

The entrance and exit pressure plates of each block should be wired to the S and R inputs of the corresponding latch, and the output of the latch should be linked to the gear assembly of the controlling signal, like this (though of course the linkages are invisible in-game):

P P
^ ^
ò ò
ò ^ ò

It's easiest to link the levers first and then use them to open all the doors while the rest of the wiring is done. Before putting the system into service, it's also necessary to toggle all of the gear assemblies to get them into the correct state relative to the latches.

Short block problem[edit]

When using fluid latches as shown above, there is a problem if a minecart leaves a block before the entrance pressure plate has reset, which takes 100 ticks. If this happens, the latch gets stuck in the full state. That means that the block shows as occupied until a dwarf can reset the latch. This is safe but inconvenient. A minimum-speed roller propels a minecart at a speed of one tile every 10 ticks, so with the forward rollers set to the lowest speed, you need 10 tiles between the pressure plates.

One possible (untested) way to fix this would be by approach locking: holding the block exit signal at red until the entrance pressure plate de-activates. This can be done by adding another gear assembly to each signal:

P P
^ ^
ò ò
ò ^ ò

Like the first gear assembly, this one needs to be toggled first to get it into the right state.

An alternative (and also untested) solution might be to use TinyPirate's Newton's Cradle Memory in place of the fluid latch. A Newton's Cradle Memory cell should end up in a state corresponding with the last of its inputs to be released, which is what we want.

Both of these approaches give a headway (the time between successive minecarts passing a point) of over 200 ticks, because a second minecart can only pass once the entrance pressure plate and the flip-flop pressure plate have cleared in series. If one could devise an edge-triggered flip-flop, it might be possible to reduce the headway to a little over 100 ticks.

Other signal designs[edit]

Another kind of signal is a station signal, used when you want a minecart to stop in the block, for instance to load and unload goods. This is very similar, but uses a track stop in place of the forward roller:

P
^

Here, if a dwarf pushes a minecart rightwards from the track stop while the roller is running, the minecart immediately returns to the track stop. Once the roller is stopped, the minecart can pass it and continue along the track.

CancelHideAbout

Rating User:Bjh21/Dwarven block signalling