- 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.
Difference between revisions of "User:Gnidan"
(Add link to original forum thread) |
|||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | < | + | == Minecart Routing == |
+ | |||
+ | [[File:Minecart-routing.gif]] | ||
+ | |||
+ | ===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:''' [http://www.bay12forums.com/smf/index.php?topic=155397.0 ''Original forum thread''] | ||
+ | |||
+ | ===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. | ||
+ | |||
+ | |||
+ | {{diagram|spaces=yes|\ | ||
+ | |||
+ | ...══[#F0F]^[#FFF]╟+╗ ╔+[#FFF]╢[#F0F]^══... | ||
+ | ╔═╝ | ||
+ | ║ | ||
+ | ║ | ||
+ | . | ||
+ | . | ||
+ | . | ||
+ | (to either a pressure plate or another shared track) | ||
+ | }} | ||
+ | |||
+ | 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. | ||
+ | |||
+ | |||
+ | ===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.) | ||
+ | |||
+ | ====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 ''waiting<sub>left</sub>'' to false, sets ''releasing<sub>left</sub>'' to true, sets ''track in use'', and signals ''release<sub>left</sub>'' | ||
+ | ; The track is not in use and the right entrance is "waiting" and the left entrance is not | ||
+ | : Sets ''waiting<sub>right</left>'' to false, sets ''releasing<sub>right</left>'' to true, sets ''track in use'', and signals ''release<sub>right</sub>'' | ||
+ | ;The ''releasing<sub>left</sub>'' bit is finished being set | ||
+ | : Unset ''releasing<sub>left</sub>'' and signal ''clear<sub>left</sub>'' | ||
+ | ; The ''releasing<sub>right</sub>'' bit is finished being set | ||
+ | : Unset ''releasing<sub>right</sub>'' and signal ''clear<sub>right</sub>'' | ||
+ | |||
+ | |||
+ | ====Track==== | ||
+ | {{diagram|spaces=yes|newlines=yes|\ | ||
+ | O O | ||
+ | ╥☼O╞═╡O O╞═╡O☼╥ | ||
+ | ║│ ☼─☼ ☼─☼ │║ | ||
+ | ╨☼O │ │ O☼╨ | ||
+ | O│╥──☼─☼─☼──╥│O | ||
+ | │║ │ ║│ | ||
+ | │║ │ ║│ | ||
+ | ☼╨──☼─☼☼☼─☼╨☼ | ||
+ | │O ☼───☼ │O | ||
+ | O╞══╡O╞══╡O╞══╡O | ||
+ | ☼ ☼ ☼ | ||
+ | }} | ||
+ | |||
+ | ====Furniture==== | ||
+ | {{diagram|spaces=yes|newlines=yes|\ | ||
+ | O O | ||
+ | ╤☼O╟^╢O O╟^╢O☼╤ | ||
+ | ^[#8B4513]│ ☼[#8B4513]─☼ ☼[#8B4513]─☼ [#8B4513]│^ | ||
+ | ╨☼O [#8B4513]│ [#8B4513]│ O☼╨ | ||
+ | O[#8B4513]│╤[#8B4513]─[#8B4513]─[#0FF]☼[#8B4513]─[#FFF]☼[#8B4513]─[#FF0]☼[#8B4513]─[#8B4513]─╤[#8B4513]│O | ||
+ | [#8B4513]│[#0FF]^ [#8B4513]│ [#FF0]^[#8B4513]│ | ||
+ | [#8B4513]│║ │ ║[#8B4513]│ | ||
+ | ☼╧[#8B4513]─[#8B4513]─[#F0F]☼[#8B4513]─[#0F0]☼[#00F]☼[#F0F]☼[#8B4513]─☼╧☼ | ||
+ | [#8B4513]│O ☼[#8B4513]─[#8B4513]─[#8B4513]─☼ [#8B4513]│O | ||
+ | O╟[#F0F]^═╢O╟═[#0F0]^╢O╟[#00F]^═╢O | ||
+ | ☼ ☼ ☼ | ||
+ | - bit linkages to inner gear assemblies shown | ||
+ | - [#FFF]☼ denotes power input | ||
+ | - Right-hand side [#F0F]☼ should be disengaged. | ||
+ | }} | ||
+ | |||
+ | 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. | ||
+ | |||
+ | ====Minecarts==== | ||
+ | |||
+ | {{diagram|spaces=yes|newlines=yes|\ | ||
+ | O O | ||
+ | ■☼O■^╢O O■^╢O☼■ | ||
+ | ^│ │^ | ||
+ | ╧☼O O☼╧ | ||
+ | O│╤──☼─☼─☼──╤│O | ||
+ | │■ │ ■│ | ||
+ | │║ │ ║│ | ||
+ | ☼■──☼─☼☼☼─☼■☼ | ||
+ | │O ☼───☼ │O | ||
+ | O╟■═■O╟■^■O╟■═■O | ||
+ | ☼ ☼ ☼ | ||
+ | }} | ||
+ | |||
+ | |||
+ | ==== 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: ''releasing<sub>left</sub>'', ''clear<sub>left</sub>'', ''clear<sub>right</sub>'', ''releasing<sub>right'' | ||
+ | {{diagram|spaces=yes|newlines=yes|\ | ||
+ | O O | ||
+ | ■☼O■[#F0F]^╢O O■[#F0F]^╢O☼■ | ||
+ | [#F0F]^│ │[#F0F]^ | ||
+ | ╧☼O O☼╧ | ||
+ | O│╤──☼─☼─☼──╤│O | ||
+ | │■ │ ■│ | ||
+ | │║ │ ║│ | ||
+ | ☼■──☼─☼☼☼─☼■☼ | ||
+ | │O ☼───☼ │O | ||
+ | O╟■═■O╟■^■O╟■═■O | ||
+ | [#F0F]☼ [#F0F]☼ [#F0F]☼ | ||
+ | }} | ||
+ | Input Signals: ''arriving<sub>left</sub>'', ''empty'', and ''arriving<sub>right</sub>'' | ||
+ | |||
+ | ; ''arriving<sub>left</sub>'' | ||
+ | : Notifies the circuit that a track is waiting to merge from the left entrance. | ||
+ | |||
+ | ; ''arriving<sub>right</sub>'' | ||
+ | : 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. | ||
+ | |||
+ | ; ''releasing<sub>left</sub>'' | ||
+ | : Sent when the left entrance gains access to the shared track. | ||
+ | |||
+ | ; ''releasing<sub>right</sub>'' | ||
+ | : Sent when the right entrance gains access to the shared track. | ||
+ | |||
+ | ; ''clear<sub>left</sub>'' | ||
+ | : Sent when the left entrance circuitry has reset and is able to receive another cart. | ||
+ | |||
+ | ; ''clear<sub>right</sub>'' | ||
+ | : 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.'' | ||
+ | |||
+ | ====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 ''arriving<sub>left</sub>'' and ''arriving<sub>right</sub>'', respectively | ||
+ | * Link output pressure plates ''releasing<sub>left</sub>'' and ''releasing<sub>right</sub>'' 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 ''clear<sub>left</sub>'' or ''clear<sub>right</sub>'' output signal to notify the preceding track that it is ''empty'' | ||
+ | |||
+ | ===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. | ||
+ | {{diagram|spaces=yes|\ | ||
+ | P──☼ <-- Initial release (sets first track bit) | ||
+ | O■[#FF0]^■╢O | ||
+ | ☼☼ | ||
+ | P─☼[#FF0]☼─☼ <-- Second track release triggers if and only if first track bit is active | ||
+ | O■^■╢O | ||
+ | │ | ||
+ | P─☼───☼ <-- Reset signal from pressure plate at destination clears last track bit | ||
+ | }} | ||
+ | |||
+ | The idea is that the track circuit ''release<sub>dir</sub>'' 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! |
Latest revision as of 20:14, 17 August 2017
Minecart Routing[edit]
Overview[edit]
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.
[edit]
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.
Track Circuit for dual wait/release setups.[edit]
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.)
Design[edit]
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
Track[edit]
O | O | ||||||||||||||||
╥ | ☼ | O | ╞ | ═ | ╡ | O | O | ╞ | ═ | ╡ | O | ☼ | ╥ | ||||
║ | │ | ☼ | ─ | ☼ | ☼ | ─ | ☼ | │ | ║ | ||||||||
╨ | ☼ | O | │ | │ | O | ☼ | ╨ | ||||||||||
O | │ | ╥ | ─ | ─ | ☼ | ─ | ☼ | ─ | ☼ | ─ | ─ | ╥ | │ | O | |||
│ | ║ | │ | ║ | │ | |||||||||||||
│ | ║ | │ | ║ | │ | |||||||||||||
☼ | ╨ | ─ | ─ | ☼ | ─ | ☼ | ☼ | ☼ | ─ | ☼ | ╨ | ☼ | |||||
│ | O | ☼ | ─ | ─ | ─ | ☼ | │ | O | |||||||||
O | ╞ | ═ | ═ | ╡ | O | ╞ | ═ | ═ | ╡ | O | ╞ | ═ | ═ | ╡ | O | ||
☼ | ☼ | ☼ |
Furniture[edit]
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.
Minecarts[edit]
O | O | ||||||||||||||||
■ | ☼ | O | ■ | ^ | ╢ | O | O | ■ | ^ | ╢ | O | ☼ | ■ | ||||
^ | │ | │ | ^ | ||||||||||||||
╧ | ☼ | O | O | ☼ | ╧ | ||||||||||||
O | │ | ╤ | ─ | ─ | ☼ | ─ | ☼ | ─ | ☼ | ─ | ─ | ╤ | │ | O | |||
│ | ■ | │ | ■ | │ | |||||||||||||
│ | ║ | │ | ║ | │ | |||||||||||||
☼ | ■ | ─ | ─ | ☼ | ─ | ☼ | ☼ | ☼ | ─ | ☼ | ■ | ☼ | |||||
│ | O | ☼ | ─ | ─ | ─ | ☼ | │ | O | |||||||||
O | ╟ | ■ | ═ | ■ | O | ╟ | ■ | ^ | ■ | O | ╟ | ■ | ═ | ■ | O | ||
☼ | ☼ | ☼ |
Input/Output Signals[edit]
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.
Hookup[edit]
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
Route Circuit[edit]
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!