User:Gnidan

From Dwarf Fortress Wiki
Jump to: navigation, search

Contents

[edit] Minecart Routing

File:Minecart-routing.gif

[edit] Overview

I've come up with a scheme for getting minecarts to travel from a source to destination automatically using shared track. The scheme ultimately keeps careful control of individual sections of shared track so that only one minecart can be on a single piece of shared track at a given time. Through carefully timed access, a signaling scheme, and stateful record-keeping of how far each minecart is along its way to its destination, I have been able to create a fully automated minecart router.

Ref: Original forum thread

[edit] Shared Track

The design for a segment of shared track comprises two inbound tracks, each with a pressure plate, roller, and door, joining into a single outbound track.


. . . ^ + + ^ . . .
.
.
.
( t o e i t h e r a p r e s s u r e p l a t e o r a n o t h e r s h a r e d t r a c k )

The pressure plates are used to trigger arrival signals, and the doors should be linked to open when the shared track becomes available for that minecart (release). The following track circuit design controls this behavior.


[edit] Track Circuit for dual wait/release setups.

The track circuit here is set up to make each arriving minecart wait until the track is empty (and possibly wait until the other side has released and cleared the track, should both carts start waiting at the same time.)

[edit] Design

The track circuit is designed to use signals for input/output. Internally, the circuit comprises 5 "Newton's Cradle" bits. The pressure plates for these bits are linked to internal gear assemblies, which function as logic gates to emit signals as output. Three of the bits get set one way from an input signal, and unset via internal mechanisms. Two of the bits are entirely controlled internally and used for timing.

To clarify the design of the track circuit, there are four logic conditions that can cause the circuit to change/emit signals:

The track is not in use and the left entrance is "waiting"
Sets waitingleft to false, sets releasingleft to true, sets track in use, and signals releaseleft
The track is not in use and the right entrance is "waiting" and the left entrance is not
Sets waitingright</left> to false, sets releasingright</left> to true, sets track in use, and signals releaseright
The releasingleft bit is finished being set
Unset releasingleft and signal clearleft
The releasingright bit is finished being set
Unset releasingright and signal clearright


[edit] Track

O O
O O O O
O O
O O
O O
O O O O

[edit] Furniture

O O
O ^ O O ^ O
^ ^
O O
O O
^ ^
O O
O ^ O ^ O ^ O
- b i t l i n k a g e s t o i n n e r g e a r a s s e m b l i e s s h o w n
- d e n o t e s p o w e r i n p u t
- R i g h t - h a n d s i d e s h o u l d b e d i s e n g a g e d .

This diagram shows the linkages from the 5 bits to the internal gear assemblies that use them as logic gates. The pressure plates with a given color should be linked to the gear assembly/assemblies with matching color. Note that a temporary lever will have to be hooked up to the right-most purple bit, and pulled, so that the gear assembly starts disengaged.

These linkages should be done before the minecarts are placed.

[edit] Minecarts

O O
O ^ O O ^ O
^ ^
O O
O O
O O
O O ^ O O


[edit] Input/Output Signals

Output signals mean an on signal followed by an off signal later. Input signals can be disengaged gear assemblies or power applied briefly. (See Minecart_logic#Techniques_and_Circuits)


Output signals: releasingleft, clearleft, clearright, releasingright

O O
O ^ O O ^ O
^ ^
O O
O O
O O
O O ^ O O

Input Signals: arrivingleft, empty, and arrivingright

arrivingleft
Notifies the circuit that a track is waiting to merge from the left entrance.
arrivingright
Notifies the circuit that a track is waiting to merge from the right entrance.
empty
Notifies the circuit that the shared track is no longer in use.
releasingleft
Sent when the left entrance gains access to the shared track.
releasingright
Sent when the right entrance gains access to the shared track.
clearleft
Sent when the left entrance circuitry has reset and is able to receive another cart.
clearright
Sent when the right entrance circuitry has reset and is able to receive another cart


The basic idea is that an arriving cart sends a signal; this sets the waiting bit. If the waiting bit is set, and the track is not in use, the release signal is sent, and the release bit is set. When the release bit is finished being set, a circuit trips, the release bit is unset, and the clear signal goes out.

[edit] Hookup

The track circuit controls access for two entrances onto the shared track. Call one entrance left and one entrance right. On each side, there should be a roller/mechanism-operated door setup restricting access to the merge. In front of the roller should be a pressure plate to signal a minecart has "arrived".

  • Link the two arrival pressure plates to arrivingleft and arrivingright, respectively
  • Link output pressure plates releasingleft and releasingright to the door part of the roller/door setup.
  • Link some signal to empty. This can either be a pressure plate at the far end of the track, or,
  • If a shared track segment leads into another shared track segment as either the left or right arrival point, use either the clearleft or clearright output signal to notify the preceding track that it is empty

[edit] Route Circuit

A route represents a single minecart that travels one way from source to destination. Route circuits have n bits, where n is the number of shared track segments the route travels on between its source and destination.

The following diagram is for an example a two-track route circuit. For routes that cover more than two shared tracks, simply add more middle layers.

P < - - I n i t i a l r e l e a s e ( s e t s f i r s t t r a c k b i t )
O ^ O
P < - - S e c o n d t r a c k r e l e a s e t r i g g e r s i f a n d o n l y i f f i r s t t r a c k b i t i s a c t i v e
O ^ O
P < - - R e s e t s i g n a l f r o m p r e s s u r e p l a t e a t d e s t i n a t i o n c l e a r s l a s t t r a c k b i t

The idea is that the track circuit releasedir signals notify all appropriate routes via linkages. Each route keeps track of where it is, so that release signals are ignored unless the minecart released is on the route in question. Appropriate bit pressure plates are then linked to gear assemblies controlling rollers. Route bits turn on the rollers that get the minecart to the correct destination!

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox
Advertisement