This is meant to be used in conjunction with my mining train wait station blueprint: https://factorioprints.com/view/-LbFY01vbgNk_tHyEbbv
Special thanks to Teoxoy and his superb blueprint editor: https://teoxoy.github.io/factorio-blueprint-editor/
WHY
Before I started using this setup, my trains were sent to mining stations to load up with resources, only to be closed before it arrives and then would go to it's drop-off empty-handed. This is one part of a train control system that helps prevent sending trains to mining stations that don't have enough resources to fill them right away and to send only enough trains to the same number of open stations.
Essentially I have trains stack to a single 'Wait' station, unique to the type of resource they're acquiring. One at a time they enter this wait station and they see over the circuit network how many stations are open of their resource type and how many trains are already en-route to them. As they leave, a 1-tick/+1 pulse is sent over the same network to a memory cell that counts the number of trains en-route to a mining station. When the train arrives at a mining station (like the ones in this blueprint), a 1-tick/-1 pulse is sent, negating 1 from the memory cell. So, using the memory cell and number of open stations, trains are only sent when there is more open stations than trains en-route.
HOW IT WORKS
-
Train stations are closed by default.
-
Mining resource is balanced/fed from the left to the first train station and inserted in chests evenly.
-
Once the quantity of the chests in the station exceeds 8000:
- Train station opens
- Belt is split and starts feeding in to the next station in the same way
- A 1-value signal of the resource type is broadcast on the green circuit wire (the one attached to the big electric pole on the bottom).
Example: If mining iron, the signal will be Iron(1). If another station of the same type opens, the signal will be Iron(2)
- When a train arrives at an open station:
- Train station closes (don't worry, train will not leave until it's full)
- A 1-tick pulse of C(-1) is broadcast on the green circuit wire (same one that broadcasts the resource type).
- Train gets loaded from chests. Because they've been fed from the mine equally, all inserters will be loading the train at max speed.
