Fluid Balancer for Rail Tanker Unloading

Smart setups of railway stations, intelligent routing, solutions to complex train-routing problems.
Please provide - only if it makes sense of course - a blueprint of your creation.
Post Reply
Mehve
Filter Inserter
Filter Inserter
Posts: 318
Joined: Sat Aug 06, 2016 9:12 pm
Contact:

Fluid Balancer for Rail Tanker Unloading

Post by Mehve »

An ongoing frustration I've had with both the rail tanker and wagon-to-assembler barrel unloading is the inability to empty multiple wagons in a balanced manner. Eventually, you wind up in a situation where only half the wagons have anything left in them, and then you're forced to choose between making the train depart early, or at the mercy of the liquid system for hoping that you can keep everything supplied while more of the train unloads. Or simply barrel everything and use a belt balancer to handle distribution.

So I decided to see if I could throw together something to solve the problem:

Image

This design doesn't work any miracles, but it's simple, compact, and can help a great deal when it comes to getting most out of each incoming rail shipment. In a nutshell, it simply compares two adjacent tanks, and if they're uneven, pumps fluid sideways to compensate. Anyone familiar with the infamous Madzuri balanced loader will spot the similarities in the circuit logic - one of the two tanks' contents are multiplied by -1, and the comparison happens automatically as each pump receives two values via the red and green wires. The design can be extended indefinitely, the wire colours allow each tank to interact with both of its neighbors without conflict, and the Each/Anything operators make this design fluid-agnostic.

Results are promising. In the image below, we have a 16 rail tanker train, with a high rate of consumption happening from the very front, but incoming product only remaining in the last car. The system still manages to maintain 15k in the storage tank being pulled from, right to the end. If you halt consumption after the train leaves, the tanks seem to self-level to within +/-500 within 5-10 seconds.
Image
Blueprint

Kelderek
Filter Inserter
Filter Inserter
Posts: 250
Joined: Tue Nov 11, 2014 6:04 pm
Contact:

Re: Fluid Balancer for Rail Tanker Unloading

Post by Kelderek »

How do you deal with the fact that the fluid wagon holds 3 times the amount of fluid as one storage tank? You need 3 storage tanks to hold the fluid from each wagon.

Mehve
Filter Inserter
Filter Inserter
Posts: 318
Joined: Sat Aug 06, 2016 9:12 pm
Contact:

Re: Fluid Balancer for Rail Tanker Unloading

Post by Mehve »

Kelderek wrote:How do you deal with the fact that the fluid wagon holds 3 times the amount of fluid as one storage tank? You need 3 storage tanks to hold the fluid from each wagon.
It's not intended to be a full one-shot unload. In fact, if there was a smaller 2x2 tank, I'd cheerfully use it instead to improve responsiveness (since fluid transfer ability is heavily based on % difference between two points). The idea is to maintain full supply to each pipe leading away from the tanker, and to do that, you don't want any of the storage tanks to ever run dry.

What happens here is that each storage tank will maintain a full 25k, up until the corresponding rail tanker runs dry. Then they'll start to drop. This design takes over at that point, trying to keep the fluid storage tanks with higher demand topped up from the storage tanks with lower demand.

That said, you could simply stack two more storage tanks above each existing storage tank in the design without losing too much functionality, and still get a ~15-20 second unload time. But that's only for the first unload. The next incoming train would still be stuck unloading into mostly-filled tanks.

User avatar
Distelzombie
Filter Inserter
Filter Inserter
Posts: 336
Joined: Tue May 02, 2017 4:27 pm
Contact:

Re: Fluid Balancer for Rail Tanker Unloading

Post by Distelzombie »

Arent they getting balanced automatically if you connect both tanks with a pipe? Isnt this essentially the same thing? Also, it sounds like it can produce an infinite loop.
Complete 2-Lane system as a Blueprint-Book! The perfect OCD reactor? Testing chained science lab efficiency Please use real prefixes and proper rounding!

Mehve
Filter Inserter
Filter Inserter
Posts: 318
Joined: Sat Aug 06, 2016 9:12 pm
Contact:

Re: Fluid Balancer for Rail Tanker Unloading

Post by Mehve »

You can balance with a pipe, but at higher flow rates, normal fluid leveling just can't keep up. And if one of the pipes is pulling 1000 units/second, while the one next to it is only pulling 500, the first tank will run dry, starving the processes upstream, while the train is still waiting for the rest of the wagons to unload. I had this problem a lot in the 2rpm base I built in 0.14, and eventually just gave up and barrelled all the crude. But in 0.15, the pumps are actually strong enough to be used to actively level out the tanks.

Because of the enabling conditions, the two pumps in each section can never run at the same time, which prevents those kinds of loops. All they'll ever do is assist the natural fluid leveling process, except much, much faster. They're also set to only activate with fluid differences of 200 or more, which prevents them from trying to level tiny amounts that don't matter.

User avatar
Distelzombie
Filter Inserter
Filter Inserter
Posts: 336
Joined: Tue May 02, 2017 4:27 pm
Contact:

Re: Fluid Balancer for Rail Tanker Unloading

Post by Distelzombie »

Mehve wrote:Because of the enabling conditions, the two pumps in each section can never run at the same time, which prevents those kinds of loops. All they'll ever do is assist the natural fluid leveling process, except much, much faster. They're also set to only activate with fluid differences of 200 or more, which prevents them from trying to level tiny amounts that don't matter.
Yea, but: Pump left starts pumping because right too full than pump right is registering that tank left is more filled than tank right and starts pumping etc etc
Anyway i trust you have a work around that. :D
I didnt know you have to use something like that in late games.
Complete 2-Lane system as a Blueprint-Book! The perfect OCD reactor? Testing chained science lab efficiency Please use real prefixes and proper rounding!

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Fluid Balancer for Rail Tanker Unloading

Post by orzelek »

Distelzombie wrote:
Mehve wrote:Because of the enabling conditions, the two pumps in each section can never run at the same time, which prevents those kinds of loops. All they'll ever do is assist the natural fluid leveling process, except much, much faster. They're also set to only activate with fluid differences of 200 or more, which prevents them from trying to level tiny amounts that don't matter.
Yea, but: Pump left starts pumping because right too full than pump right is registering that tank left is more filled than tank right and starts pumping etc etc
Anyway i trust you have a work around that. :D
I didnt know you have to use something like that in late games.
Two notes:
1. Pumps don't help natural autoleveling. They block it when disabled since disabled pump doesn't transfer anything.
2. I think it's recursion safe since you need at least 200 fluid difference for it to work. Might be a bit better off with slightly more there since pump can hold 200 liquid right now.

Mehve
Filter Inserter
Filter Inserter
Posts: 318
Joined: Sat Aug 06, 2016 9:12 pm
Contact:

Re: Fluid Balancer for Rail Tanker Unloading

Post by Mehve »

Yeah, I found that if the pump check conditions were set for less than 50, you started to get infinite cycling where the pumps would be endlessly triggering each other, but at 200 unit check difference, things seem to quiet down quickly. And while you do technically lose natural autolevelling, it's only because you have the far more capable pumps doing the job instead. The 200 unit margin that the pumps work around is technically a <1% margin, so it's not a big issue in lieu of the intended volumes of liquid passing through.

Post Reply

Return to “Railway Setups”