Coordinating trains by controlling exit signals

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Post Reply
Amarula
Filter Inserter
Filter Inserter
Posts: 512
Joined: Fri Apr 27, 2018 1:29 pm
Contact:

Coordinating trains by controlling exit signals

Post by Amarula »

I set up a direct insert rocket silo line. I decided to have odd and even supply trains... which I probably won't do again but it was an interesting experiment.
Odd and even silo supply trains.png
Odd and even silo supply trains.png (635.02 KiB) Viewed 1078 times
Then I decided that I wanted more control over the trains. Specifically, I don't want the odd trains to produce rockets faster than the even trains can keep up. As you can see, there is one train taking away the space science, and I don't want the odd wagons to have more science packs than the even wagons.

I decided to use combinators to control the exit, so that both trains are forced to exit together, that one train can't take off on its own. Again maybe not something I would do again, but it has been an interesting few days trying to get it to work.

It is pretty straightforward to track the supply trains. At first I though of counting arrivals and departures, and I kind of got it to work... I found some advice for zeroing a counter 'put a decider after the counter and don't output the count when you reach the reset limit.' It went 1, 2, 3, 4, 0... perfect. Except that the next time through, the counter started where it left off, 5, 6, 7, 8. I tried hooking the output of the test as the input to the counter, and that didn't work - it flickered 1, 0, 2, 0, 3, 0, 4, 0... and every time it went to zero, my control signal went from red to green.

So here is my working spaghetti monster:
I track the trains: A = T + 0, and B = S + 0 (changing the default train ID from T to S).

When the trains leave, I track the departure: odd train O = T < A, even train E = S < B. If either train is present, P = A OR B.

The departures are kept as state machines, with the reset condition being the departure of the other train: O = O > E, E = E > O.

Departure if either train has left: D = O OR E. The final lock condition L = P OR D.
Train control test setup.png
Train control test setup.png (367.42 KiB) Viewed 1078 times
This blueprint contains all the combinators, one train signal, and one constant combinator that I used for testing during development, by manually entering and removing the train ID variables S and T.
My own personal Factorio super-power - running out of power.

Post Reply

Return to “Combinator Creations”