Page 1 of 1

Satellite insertion rocket launch controller

Posted: Sun Jul 03, 2022 8:54 pm
by Amarula
TL;DR Just because you can, doesn't mean you should.
... If you build it, they will come.
... Rube Goldberg eat your heart out.
... Wait for train to load space science and leave, to ensure room in silo before next launch.

My current base uses 1-3 trains as that is a reasonable wagon count for just one locomotive.
Silo overview
Silo overview
Silo overview.png (876.82 KiB) Viewed 1504 times
Previously I have used a simple combinator set, one combinator to count the satellites, and hook to the train stop so the satellite isn't loaded and launched until there is a train at the stop to take away the science packs.
Read satellite inserter.png
Read satellite inserter.png (22.44 KiB) Viewed 1504 times
Count satellites
Count satellites
Count satellite launches.png (351.3 KiB) Viewed 1504 times
Read stopped train
Read stopped train
Read stopped train.png (18.43 KiB) Viewed 1504 times
The only nitpick with this simple solution is that it takes a couple of minutes to run through the launch and start loading the science packs. Not normally an issue with trains arriving regularly, but if a train is delayed for any reason, there is another avoidable delay here. So I wanted a system that launches the rocket right away, but doesn't launch the next rocket until the train is loaded and leaves the station.

So to do that I decided I would: count the trains and not load the satellites unless the train count was balanced with the satellite count; and I had enough satellites to launch all my rockets (in this case three, one silo loaded from each supply train wagon; and the train had actually left the station (or at least tried to leave the station after it was loaded).

To count the trains, I decided to use a state machine (total overkill I know but hey it works!). And because I already knew I was going to need an indicator that the train had left, I used the train not being there to set the state machine, and the train arriving to reset it.
Set when train absent
Set when train absent
Set latch train absent.png (292.06 KiB) Viewed 1504 times
Reset when train present
Reset when train present
Reset latch train present.png (296.3 KiB) Viewed 1504 times
Latch train absent
Latch train absent
Latch train absent.png (383.36 KiB) Viewed 1504 times
This was one of the fun parts: when the train is not there, S is set to one. On subsequent ticks, the state machine latch also sets S to one, so the value of S goes from zero, to one, to two, and stays there until a train arrives. At which point, R is set to one, and S does not get set to one by the set combinator, only by the latch. So S drops from two, to one, and back to zero.
So I used that tick, when S = R = 1, to count the trains 8-)
Capture train arrival
Capture train arrival
Capture train arrival.png (270.39 KiB) Viewed 1504 times
Count trains
Count trains
Count trains.png (289.44 KiB) Viewed 1504 times
I use four verification combinators: one, B, to verify that the satellite count is balanced by the train count; the second, E, verifies that there are enough satellites in the loading chests to load all three silos; the third, C, verifies that both B AND E are true; and the fourth, L, verifies that both C AND S are true.
Verification
Verification
Verify train absent and balanced-enough.png (468.39 KiB) Viewed 1504 times
Note that counting that there are enough satellites available is done via the green circuit network, so it does not conflict with the count of actual launches on the red circuit network.