Minecart Routing
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.
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.
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.)
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
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.
 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
Input Signals: arrivingleft, empty, and arrivingright
- Notifies the circuit that a track is waiting to merge from the left entrance.
- Notifies the circuit that a track is waiting to merge from the right entrance.
- Notifies the circuit that the shared track is no longer in use.
- Sent when the left entrance gains access to the shared track.
- Sent when the right entrance gains access to the shared track.
- Sent when the left entrance circuitry has reset and is able to receive another cart.
- 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.
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
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.
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!