<ins>Background</ins>
I had the somewhat unique (and self-inflicted) problem that my rocket silo is far away from my base. I thus have 4 requestor chests at my base next to a train stop in which each chest requests one rocket component (chest 1: 720 blue chips; chest 2: 720 units of rocket fuel; chest 3: 1 satellite; chest 4: 720 low-density structures). The inserters transfer items into the train, which brings them to the silo.
But, since my base produces these items unevenly, I ran into a problem rather quickly. The bots easily delivered 720 units of rocket fuel, for example, but only a few blue chips and low-density structures. The train shuttled these to the silo; meanwhile, bots bring more rocket fuel to the requestor chest, so the train eventually shuttles that over while bringing only a handful more of the other components, and so on until there’s a giant backlog of rocket fuel at my silo and on my train while my base produces enough of the other components for a rocket launch.
To combat this, I wanted a system in which the inserters remain disabled until all four chests contained 720 of the three components and the 1 satellite, then the inserters turn on and move precisely 720 of each component and 1 satellite, then shut off until the chests contain 720 of the three components and 1 satellite again. This meant anytime the train moved cargo to the rocket silo, it was enough for exactly one launch and there’s no backlog.
Most people would just move the silo into the base and avoid this altogether, but I didn’t want to do that, so I spent about a day and a half figuring out a circuit to do the above. In case anyone in the future wants an overcomplicated solution to a non-problem like I did, I’m sharing what I came up with.
<ins>Circuit overview</ins>
Referring to the image, we have the four chests and four inserters as described. We also have nine decider combinators labeled A through I. To start, all four chests link to Decider A, which is set up as:
Input condition: blue chip, rocket fuel, and low-density structure ≥ 720; satellite ≥ 1
Output: [set] = 1
Decider A outputs to Decider B, which acts as an SR (or RS?) latch
Input condition: [set] > [reset]
Output: [set] = 1
In this case, Decider B outputs the [set] signal if the chests have the correct number of items to Decider C, which repeats the signal on a different colored wire (the wires coming out of Decider B are red; I needed them to be green):
Input condition: [set] > 1
Output: [set] = 1
Decider C links to the inserters, which are set up to enable when [set] > 1.
Each inserter, meanwhile, outputs to Deciders D through G, one decider per inserter. These act as counters and keep track of how many items each inserter has moved:
Input condition: [RED] = 0
Output: everything – input count
