Satellite insertion rocket launch controller
Posted: Sun Jul 03, 2022 8:54 pm
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. 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. 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. 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 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. 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.
... 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. 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. 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. 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 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. 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.