Smart Pumping Station

Post pictures and videos of your factories.
If possible, please post also the blueprints/maps of your creations!
For art/design etc. you can go to Fan Art.

Post Reply
dawaltco
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Apr 11, 2016 1:13 am
Contact:

Smart Pumping Station

Post by dawaltco »

Yo, just launched my first rocket, and I got one design out of the process that I'm really pretty proud of. Was having trouble producing enough empty barrels to be constantly filling at my remote pumping stations without clogging up conveyor belts. I was intent on using the same cargo cars for both delivering empties and taking back full ones, so if the empties couldn't unload at the station, then the fulls couldn't load.

My solution:
Smart Pumping Station.png
Smart Pumping Station.png (2.1 MiB) Viewed 4847 times
The station goes through two phases: 1) if there are any full barrels waiting to be loaded, begin unloading empty barrels (to make space). 2) once there are no full barrels left to load, stop unloading empties and begin loading them from the other side. In the end, the train has picked up all the filled barrels and then filled the rest of its cargo with empties. It can continue running to multiple of these stations, delivering more empties along the way. Eventually, the total amount of empty barrels should become roughly equal across stations.

It all comes down to the circuit network, which works like this: 1 green input line and 2 red output lines, and a third red input/output line.

Green line: reads the amount of empties in the four smart chests being loaded into the assemblers, as well as the amount of full barrels in the four smart chests being loaded onto the train. This runs into the six smart inserters loading empties onto the train, which are set to load if [full barrels] = 0. It also runs into the two combinators on the far right, which connect to...

Red line 1: The first combinator outputs 1 green signal if [full barrels] > 0. The second outputs 1 green signal if [empty barrels] < 1500. 1500 is semi-arbitrarily chosen to be a little less than the capacity of the four leftmost smart chests. Red line 1 carries these signals to the ten rightmost smart inserters, which are set to unload empties from the train if [green signal] > 0, so if either condition is fulfilled. The first condition does most of the work; I added the second condition because I realized there was no way otherwise to deliver empties to a station that has not filled any barrels, so there was no way to get one of these running from scratch.

The green wire also runs into the middle combinator, which connects to...

Red line 2: if the middle combinator reads less than 1500 empties from the green line, it outputs 1 empty (arbitrary signal) along red line 1. This line does not interact with anything else in the pumping station, but runs straight back to my main base, where some assemblers are set to produce more empties if [empty barrels] > 0. So basically make more barrels until every station is full.

Red line 3: this line does not connect to the green line, or any other line; instead it reads directly from the top and bottom pairs of smart chests which load full barrels onto the train, into separate combinators. Each combinator outputs a green signal if [full barrels] < 900 (semi-arbitrarily chosen as less-than-capacity for each pair of smart chests). This runs to the four leftmost smart inserters unloading full barrels from the assemblers, which are set to run only if [green signal] > 0. This is to prevent a backlog of full barrels, since once the loading chests are full, the full barrels will move past them and be stuck next to the loading chests for empties. This is pretty rare, but has happened a few times and its a pet peeve of mine.

That's basically it.

Full disclosure: I may not have realized that you can filter cargo car slots until after I made this... :roll: but it's still technically more dynamic and efficient: you don't have to worry about your train carrying less than capacity (either filled or empty barrels) thanks to unused filtered slots.

In before the new update makes this all obsolete probablyyyy. <3

Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Re: Smart Pumping Station

Post by Frightning »

This is actually technically unnecessary for the following reason:
The number of Empty Barrels that a station has room to receive from a train unloading will be at least as many as the number of Barrels it has filled since the last train visited it.

Edit: I wrote before seeing how you designed your station. What I said is true if you design the station so that all incoming empty barrels must follow the following progression: Empty Barrel gets unloaded -> Goes to Assembly Machine to be filled -> Leaves Assembly Machine to be put into loading chest -> Gets loaded onto train. Your setup allows empty barrels to be reloaded back onto the train, as long as you avoid designing your station to allow that, what I said above is true and you can be assured that your train can always load as many filled barrels as the station has up to the train's maximum cargo capacity.

dawaltco
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Apr 11, 2016 1:13 am
Contact:

Re: Smart Pumping Station

Post by dawaltco »

Frightning wrote:This is actually technically unnecessary for the following reason:
The number of Empty Barrels that a station has room to receive from a train unloading will be at least as many as the number of Barrels it has filled since the last train visited it.
Not totally sure I understand your solution. Do you have an example? The only way I can see it working is with one loading and unloading inserter each. Otherwise there's the possibility of the filled barrels not being evenly distributed among loading inserters, in which case it would unload more then it loaded before the unloaders stopped.

I could definitely see there being a simpler solution in .13 though, esp if there's a way to store variables in the network.

Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Re: Smart Pumping Station

Post by Frightning »

dawaltco wrote:
Frightning wrote:This is actually technically unnecessary for the following reason:
The number of Empty Barrels that a station has room to receive from a train unloading will be at least as many as the number of Barrels it has filled since the last train visited it.
Not totally sure I understand your solution. Do you have an example? The only way I can see it working is with one loading and unloading inserter each. Otherwise there's the possibility of the filled barrels not being evenly distributed among loading inserters, in which case it would unload more then it loaded before the unloaders stopped.

I could definitely see there being a simpler solution in .13 though, esp if there's a way to store variables in the network.
The key is smart inserters. You have a double sided loading/unloading configuration will all of one side for loading and all of the other for unloading.
On the unloading side, the inserters which actually unload the Cargo Wagon are Smart Inserters which have had their item filter set Empty Barrels if this station is where you're Pumpjacks (or at least your barreling Assembly Machine) is. At your base/unbarreling station, the Smart Inserters are instead set to Filled Crude Barrels. The result is that the unloading Smart Inserters only take the correct item out of the wagon and won't removing the returning barrels, I have such a setup in my first factory for an Oil outpost, I may go snag a pic of it in action.

Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Re: Smart Pumping Station

Post by Frightning »

Here are pics of each side of the system:
Unloading/main-base side:
20160605231914_1.jpg
20160605231914_1.jpg (371.22 KiB) Viewed 4547 times
Loading/outpost side:
20160605232000_1.jpg
20160605232000_1.jpg (375.4 KiB) Viewed 4547 times
As you can see, it's really quite simple. You unload the barrels you want to unload with Smart Inserters with their item filter set to the item you want it to unload, run them by loading assembly machine, and at the other side loading is easy. I have 600 barrels in this system (enough to fill the one wagon I have twice), this ensures that there is always enough barrels at the loading station for the machine there to be able to fill a full trainload by the time my train has deposited its cargo of filled barrels and returned (I never got close to that much throughput, and now that my pumpjacks are depleted, I get 17 barrels per trip, and that's with maximum 200 second wait time at both stations).

Aladrius
Inserter
Inserter
Posts: 22
Joined: Thu Jun 09, 2016 12:04 pm
Contact:

Re: Smart Pumping Station

Post by Aladrius »

After messing around with a few different ways of handling oil shipment, I came up with the following (this is for 1 refinery station and N oil producing stations):

Each train car that hauls oil has 10 slots reserved for empty barrels, 10 for full, and 10 un-assigned slots. You can use fewer reserved and more flex slots, but I found this setup moved plenty of oil. Leaving all the slots open ends up with trains full of empties that are unable to 'trade' empties for full if the receiving stations don't need any barrels, but have full barrels waiting for pickup.

The refinery (offload) station pulls as many full barrels off the train with smart inserters as are available, and loads as many empties as are available. Assuming all the oil being produced is consumed or at least un-barreled, trains will normally leave the station with 200 empties.
At each oil well station, there's a storage tank and assembler filling barrels. Storage tank is linked to an arithmetic combinator that divides oil by 25 to give number of barrels of oil on hand waiting to be canned. Smart inserter unloads empties into a smart chest up to the number required. Dumb inserter stuffs as many full barrels onto the train as it has / will fit. I keep the stops pretty short (10s). With stack bonus, oil transacts very quickly, and the assumption is the train will pick up the filled barrels it just unloaded on the next trip around.

Back at the refinery, I sum up the full & empty barrels on hand. If there are less than 200 total sitting at the refinery, I switch on production to produce more barrels and add them to the empty barrel chest. This lets me add trains and stations to the system without having to go back and manually add barrels. I was originally just adding barrels if the empty barrel box ran dry, but this ran amok when I was making more oil than I needed and jammed every station with full barrels. Counting both empty and full on hand was a better indicator of the system needing more barrels and hasn't gone wrong so far.

The arithmetic combinator measuring oil on hand and converting that into number of barrels waiting to be canned is what really made the oil system manageable for me. Depleted, low production rate stations just offload the handful of barrels they need, and newer stations take them much more aggressively. There's no need in this system to match up barrels loaded/unloaded 1:1, and the total number of barrels in the network is fairly low, 200 per train, 200 at the refinery, and a variable number at the stations, depending on how quickly they're producing and how often trains visit.
Remote Station
Remote Station
Screen Shot 2016-06-06 at 10.49.41 AM.png (573.85 KiB) Viewed 4302 times
Typical remote station. Right now I have two oil trains serving 10 remote oil fields -- all running at or near depleted levels. Each train delivers ~40 barrels on each round. I've adjusted the schedules down to a 5 second stop at each depleted station which is plenty of time to transact the 5-12 barrels they're making between each run. Looking forward to .13 and some more fine tuned control of station dwell times.
Main Station
Main Station
Screen Shot 2016-06-09 at 8.16.28 AM.png (526.78 KiB) Viewed 4302 times
Main station in this shot is backed up -- more oil is coming in than I'm refining, so tons of full barrels are currently in inventory. The combinator adds empty and full barrels in the main station, if it falls below 200, the smart inserter at the top starts putting more empties in from the requester chest.

TLDR: Smart inserters filter to only unload empty barrels -- arithmetic combinator lets them unload only as many barrels as a station has oil to fill. Avoid barrel creep, adjusts to changing production levels over time.

Post Reply

Return to “Show your Creations”