Balanced Fluids Train Station

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.
Rexcouth
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Oct 17, 2020 8:03 am
Contact:

Balanced Fluids Train Station

Post by Rexcouth »

Loading trains with fluids have always been a challenge for me, because one wagon will fill faster than the others, etc. I am sure most of you have a way to balance them, but despite my searches I have not found it. I humbly submit a solution I've found.

Code: Select all

0eNrtW01u4zYUvkqgba2B+PcoezdZ9ALdFFMUhmwzDlFZMmQpbRD4AL1FFz1ZT1JKTmzHJsVHdmaANNnYsWl+eno/H9+P8pQsyk5tG121yewp0cu62iWzX56SnV5XRdl/1z5uVTJLdKs2ySSpik3/aaWWeqWadFlvFroq2rpJ9pNEVyv1RzIj+4kXoKzN1rrVD+psI0VsvCs7vUp/L9Z1dbaTIXYWjW7vN6rVS7vYfP/rJFFVq1utDkoYPjzOq26zUI25ryPUrm0Kvb5vU/NWmits653ZZSQy1+6lEZPkMZmlUu57uS5g6JgWr7AofcYSn4SRdaUbtTwsmwVjrrapy/lC3RcP2mw3e55B52ZtNQDt+m/vdLNr51caetBN2xXlSUmHX6S3vV52qsfAb/rcbzL3si2a4V5myT9//m1+VXfttgu4+M8HnO2juYeuaud3Tb2Z68pgJLO7otyp/bBeVQdNDPdH+pdGrc7tps0nInurrhulKtuSAaKunWCWbfZjZ25QN8VapW1R/WaxnLHYs+243XaYGzAQS90sO90epHIIxY9CbfXWSFSn68Yob2URSx7FunIpsCALTwBdXyAfv+srjz3h4px2oIAzKukWjV4WhsFOPtvzWNt/NROZccCtMh45iJD8EOGQxrEDXI6Nu5V0WBDQFmTEbUFqQZZH5I1a6W6TqtL83Ogs3dalsuCzV45rQcxPsnabrQ0hRL5pMK9ahSJZELES/gxGP4g1glg5dxJrvzQSAdTFYYQgmZWcKIzEMysjOGol9FVkWsSZHsWh9nghzANBsyMEc0BwPIRLCuGDIF4pwBP5l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kMeVLM7+HZOuORTCZJkIGC//xdac0IP
You will have to set the Arithmetic Calculators, 6 in total, for the type of fluid you have. Also when hooking it up to your pipeline for the first time, connect all the tanks on the outside, to get some fluid in there to start, then disconnect them, so you are left with what's in the blueprint. Hope that makes sense. It's been running a few hrs in my base, and it seems to be working well.
coppercoil
Filter Inserter
Filter Inserter
Posts: 502
Joined: Tue Jun 26, 2018 10:14 am
Contact:

Re: Balanced Fluids Train Station

Post by coppercoil »

Could you add a screenshot of the setup? This would answer many questions: how many cars, how many outputs, how big, is it nice etc :)
Rexcouth
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Oct 17, 2020 8:03 am
Contact:

Re: Balanced Fluids Train Station

Post by Rexcouth »

Absolutely, I noticed a little problem with this setup, if you run out of supply, it has trouble restarting on it's own. Anyone have any ideas? In my creative world, with a perfect supply it worked well.
*EDIT* I have been playing around with it, and POSSIBLY fixed a low or close to zero flow rate.

Code: Select all

0eNrtW91uq0YQfpWI25qI/QdLrXRy0RfoTZWqsrDZOKtiQBjSRpEfoG/RZ+uTdMEnxiG77A5Jc5ST3NhxYD9m5puZnZm1H4J13sqqVkUTLB8CtSmLfbD87SHYq22R5t3/mvtKBstANXIXLIIi3XWfMrlRmazDTblbqyJtyjo4LAJVZPKvYIkOCydAXuqlZaPu5NlC7LHwJm9VFv6ZbsvibCXxWJnWqrndyUZtzGLTw++LQBaNapQ8GqH/cL8q2t1a1lqvE9S+qVO1vW1C/ZbrJ1TlXq/SEulna6SQMn3vvVYIa8GCTNVyc7zcaziCxf6wNPGHJQBY4Q9LAbDMH5YBYIk/LAfAAigT/rAEQFkMgAVQlgBgAZShCIAL4AwB4owASEOAQMMA1hAg0jCANgQINQzhDRBrGMIbINgwhLch2nYyU+0ulLm+v9Z5vCpzaYzl+PLRIPSSHUygQ6xV7a4yJ9sTiBkicUOQaQgcwVVDLtUwcspFHKphDJaLcKdcxC2Xy15DSHQeVoT7pqwm/YuN/GuhfTM9/h3ohZsy1zWAXqVfNBf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Y+QlkZgv4Je0Bd894nil2yT40mwwNOTYMF9Z848efUnmY3H3P1g/Caucz3Xdcyh5DnAFNCZO3mjbPeddIOe2c58g+17BsKjCh3yneVbhCKGgDALiEcPhl0gceQGIU4Q995/lvVsIO7ua+gDrSAe3VfiBPHovmInCIOAWPwk5hDD9i2c9vj+FyPLsx/FLII8XUsdfsFVmqfFRmYXKKQhuvi5q5QvfjnNoO9kvT9WiDGigiaCCxRxxg+H/wBDPP/Y
See attachment for a pic of the setup. It is setup for a 1-4-1 train. You can go as big as you want, as long as your source is big enough. It could also be compacted further, but as it is right now I think it's pretty small.

Let me know if you use it and if it works for you!
Attachments
Balanced 1-4-1 Fluid Station.png
Balanced 1-4-1 Fluid Station.png (1.69 MiB) Viewed 8170 times
MassiveDynamic
Filter Inserter
Filter Inserter
Posts: 261
Joined: Sun Sep 16, 2018 10:44 pm
Contact:

Re: Balanced Fluids Train Station

Post by MassiveDynamic »

Your main problem is trying to fill your train via pipe. Put your tank two spaces from the track and pump directly from tank to fluid wagon (and vise versa) for 1 second filling.

Also, how mega is your gigabase? You shouldn’t need that much lube unless you are well into the late late game. And further, it looks like you are diluting the fluid from one tank to two then four tanks. Unless you have a large number of lube plants you will struggle to do that. (Actually even with large production it would be hard with that level of dilution.
Rexcouth
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Oct 17, 2020 8:03 am
Contact:

Re: Balanced Fluids Train Station

Post by Rexcouth »

I will try that, thank you. I chose lube because I was in creative world, and tired of looking at black oil.

-Tried your suggestion but it doesn't fill the train evenly. Can you post a blueprint of what you mean? Thanks

--I added another combinator to check if the system is level (or zero) so it will turn on one pump to start everything again. Looks like it is working now.
MassiveDynamic
Filter Inserter
Filter Inserter
Posts: 261
Joined: Sun Sep 16, 2018 10:44 pm
Contact:

Re: Balanced Fluids Train Station

Post by MassiveDynamic »

I can ... in a few hours.
Meanwhile, just to be clear, may I ask questions?

1) Why exactly do you need this? (Just curious)

2) Do you understand that it is inefficient to try to fill 4 wagons from one tank?

3) What is the air speed velocity of a sparrow?
Rexcouth
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Oct 17, 2020 8:03 am
Contact:

Re: Balanced Fluids Train Station

Post by Rexcouth »

My goal is to load the train with fluid evenly, regardless of number of sources, or how much fluid is coming in from them. It is pretty inefficient for a train to be waiting on just one wagon to get full to leave the station. Please post a blueprint of your fluid loading station that evenly loads trains.

Ex: pumpjacks are a constant source, and just connecting 4 tanks to a few of them, they don't fill evenly. This iteration seems to be working the best so far:

Code: Select all

0eNrtW9lu4zYU/ZWAr7UGEjdJBlpg8tAf6EsxxcCQLSZDVBu0BA0C/3speSI5NqlLKqkDN3kJIEs+vvfchXdRntA260RVy6JF6yckd2XRoPVfT6iR90WS9Z+1j5VAayRbkaMVKpK8v2rask7uhdcmxd9ov0KySMU/aB3sv6+QKFrZSnHAGS4eN0WXb0WtHhgRcpHKLvdEJnZtLXdeVWZC4Vdlo75cFv0vK0CP0ugLW6FHtMaYfmH7/eoME4+YVZdXWox4xNAiEBiBzCNQd70CSC8GSkUAvbizVIRDUoWwVABX0YQgK+VCpXdfl12RApbjenliFzQCoQW+AxwBhQsCFzhYusnVk1q2P3LRKlvuynwri0RF5Hz8EF8Fqgrwti6zzVb8SB6k+op6bsLaqNvp8P2mv3En66bdnKWCu6yT6ZQLdnWXCq+UWZ8IGtFD9DiNyg3tEJ1lJerkIBT6RX2v7Nqq0+A+yLrt1CdTlhme8L6i/f4geqHc91m4oP9Ti/Q4zSix1kG4/66exobbuL+tJZcsIJdePbm3ZnLvayGKM3qjiV7tA2aCqTvB5KN5Lybz3huZyGULyP143qtOJMB7jQTzRccW8VUqX6FU1gf5VKmgAw/1ldV8PscDtG1aVGzvZL3rZHu4NukZ2YtCT0Q50hK7pBRiKdqys97OBNjl5Kd4BA9OwbkOfKoDmjzJMi9LDHWm/0JqHRR2kdM3y4l14MTa+GSpH1I7Y2O6qBKzNDaz1/OtnJxZ6s0XlYyWeofufcrYEfQ/tjzfHLvbcB2f8vHyPvGB++dJY2WXXi4gid6y0SvaMUfy6bzKhAEqhcD92Jp8dnFJ9ORPZ0cqdjIVtX3fxA3F0U8gu8popjwcSyOXsqcXKa+SepB/jX5F/QfVoxKmK9rNXV3mG1moWgqt27oTLhVoaDQmnm+tiIl84ruSH1+G/Nsl5H89I/+3BZXrnwcUrcXukqx5b5MF8EwsHI3EDEZ6jszRSAts9JOo56YhOHN8B6JOUzl0FGATOxYzR3YRdr4tZUfrLYRY6k9cA5pcVTZdEtDfLh/QehsajTZV1E23VQ4zWEg7mh5NpYNhjrYnn8ncyfaR2fbRfDLnJstzeGh/hcmcWSar0NVh6Uct/excT592TIMzEsHOd5VnZQh0Nra1hGtnQj7P0nd3avpyWgiUx6F+lEcDFxDDTpBiGISDkhAYhIEg1AXEpA5zn5Sa5OGgPAS2UegCYlIqgkFgG8UwCGgj5ruAGNRhgf2KYASjvssAi1nO1JiT90cGfZZsfqckHH+IxSQLZmtP7psstGTrG189ua6LSQYtJs0EO+wywpNoXLjLYJY7HMZd8p4pOl3L9yngKf3sN8HA7h1rNeNz5phnpuqIwSX/tDum5Er6TQYU/Myy4GfOqwh8GYd+w370f+bQ3H/F+50Uv6byOfMyYCHGgG0mx7arO0YvLomefHgVMb2M8J9mk7cdIHBsly84dh0Q8KvKF+89ILDMF/oHjE5r0VFPR6DhXWtOXUCYAYTBIBgEgSu5qSMygsC99FHWNIHAvfQ0GjCCWPTSMQQSWvTSEQgSuICY3snHLsQaRgMhcQExjAZC6gIyVPwq9ob/LVkf/SvKCmXJVqhEgG6TLCl2Ir0JPOoFN7/3bdzNH+Pu6kHUzaF9iQIa0jjkYeBzxvf7fwHfDenC
I will answer your questions, although I'm not sure why you cannot post the solution? It doesn't seem very constructive.

1) To fill the wagons evenly, to prevent the train waiting at the station for only 1 of the wagons to fill.
2) I am not filling 4 wagons from one tank. I am using tanks as a means to balance the amount of fluid available to 4 pumps, to load the wagons evenly.
3) Why is that relevant?
User avatar
ranzolger
Inserter
Inserter
Posts: 29
Joined: Fri Jun 01, 2018 6:40 pm
Contact:

Re: Balanced Fluids Train Station

Post by ranzolger »

this is my take on that subject:

balanced fluid station.png
balanced fluid station.png (4.34 MiB) Viewed 8108 times

the content of each pair of tanks will be translated into a number, the pumps compare those numbers and even out the tank content (only when
fluid>500
). this will not work perfect when the demand (for unloading stations) or supply (for loading stations) is not high enough.
to make it an unloading station just rotate the pumps (tank-wagon to wagon-tank).



bp to copy

it is used in the bp book: 'The Refinery'.
MassiveDynamic
Filter Inserter
Filter Inserter
Posts: 261
Joined: Sun Sep 16, 2018 10:44 pm
Contact:

Re: Balanced Fluids Train Station

Post by MassiveDynamic »

Rexcouth wrote: Sat Oct 17, 2020 8:14 pm My goal is to load the train with fluid evenly, regardless of number of sources, or how much fluid is coming in from them. It is pretty inefficient for a train to be waiting on just one wagon to get full to leave the station. Please post a blueprint of your fluid loading station that evenly loads trains.

I will answer your questions, although I'm not sure why you cannot post the solution? It doesn't seem very constructive.

1) To fill the wagons evenly, to prevent the train waiting at the station for only 1 of the wagons to fill.
2) I am not filling 4 wagons from one tank. I am using tanks as a means to balance the amount of fluid available to 4 pumps, to load the wagons evenly.
3) Why is that relevant?

Ok, sorry for seeming rude, I was in the middle of a settlers of catan game with my family and couldn't give this my full attention. I lost.

Anyway, what I was trying to convey is that since fluids balance themselves in connected tanks and pipes, this entire system is redundant and unnecesary. That said, I don't mind building useless machines, so I did provide a blueprint. The thing is that whether you wait for 1 wagon to catch up or all wagons to fill equally, there is no net gain in time or efficiency. Both results are theoretically equal.

As far as my questions go...
1) As I just explained, your premise is logically flawed, but a puzzle to be solved anyway. As long as you supply adequate fluids to fill the wagons they will get filled.
2) Really the same as 1
3) The correct answer is a question "African or European" and a Monty Python reference that went by you.

I hope this helps...
Rexcouth
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Oct 17, 2020 8:03 am
Contact:

Re: Balanced Fluids Train Station

Post by Rexcouth »

Thank you, ranzolger for being constructive.

MassiveDynamic, why do you apologize for being rude, and then turn around and continue to be rude? If you feel that my goal is 'redundant and unnecessary', then why are you wasting your time on it? Please feel free to excuse yourself from the topic and continue your day. Your blueprint does not accomplish the goal.
MassiveDynamic
Filter Inserter
Filter Inserter
Posts: 261
Joined: Sun Sep 16, 2018 10:44 pm
Contact:

Re: Balanced Fluids Train Station

Post by MassiveDynamic »

Apologies again for seeming rude. I honestly am trying to be helpful. I am afraid that I am not grasping the actual point of your question. My blueprint takes the total available fluid and divides it by 4 (the number of pumps) then checks the fluid level of each tank and operates any pump that is connected to a tank that is greater than the average fluid amount.
I believe that Is what you want?

I will now respectfully recuse myself from further engagement on this topic. I hope you find your solution.


P.s. Stating that the system is redundant and unnecessary is not meant to be an insult. As I stated, I enjoy solving the puzzle regardless of it’s usefulness. I was merely trying to point out that the fluid mechanics already solve the problem without the need of balancing.
Cheers.
User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1621
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Re: Balanced Fluids Train Station

Post by jodokus31 »

Another possibility is to enable the loading station only, if all tanks are filled to a certain level.
This should reduce the waiting time for the train at the station

This can be done by connecting a circuit wire to each tank and read the full amount divided by count of tanks.
f.e. if this is 20k (80%), enable station
jeanmarc
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jul 21, 2017 7:13 pm
Contact:

Re: Balanced Fluids Train Station

Post by jeanmarc »

Hi,

A method I found working well for me is to have the pumps compare the negative average of all tank's content to the content of their individual tank and pump in only when the difference is smaller than zero. I haven't found this solution by myself; I got it from a post describing the solution for loading chests evenly with inserters, but it works just as well for pumps and tanks.

Here an image, blueprint and explanations for the key points:

oil-pickup.png
oil-pickup.png (6.43 MiB) Viewed 7934 times
Key points:
  • All tanks are connected together and with the input of the arithmetic combinator with a green wire.
  • The arithmetic combinator divides the total content by the negative number of tanks.
  • All input pumps are connected together and to the output of the arithmetic combinator with a green wire.
  • Each input pump is connected to its individual tank with a red wire and is set to pump only if 'Everything' is smaller than zero.
What this all means is that the pumps only add fluid when there is less or equal product in their individual tank than the average of all the tanks content.

In this specific blueprint, I only activate the train stop when there is enough fluid to fill 4 wagons. Since the pumps are set to check 'Everything' instead of oil, you can use the setup for any fluid.

I use the same method for inserters and chest as you can see for the coal pickup in the picture.
tamanous
Fast Inserter
Fast Inserter
Posts: 138
Joined: Wed Aug 10, 2016 8:35 am
Contact:

Re: Balanced Fluids Train Station

Post by tamanous »

I am quoting Fluid System, Flow from the official wiki and then write a short interpretation.

This is how the game mechanics work at the current game version:
All connected tanks and pipes are treated as a single vessel in that the level of fluid must be equal in all parts. The flow rate between pipes is dependent on the difference in level between the adjacent entities, it becomes slower as pipes even their levels out.

Coming back to how the 'level' is defined, this also means that all connected pipes and tanks attempt to even out to the same percentage of their respective volumes. For example, if 12 550 units of fluid are left to flow into a storage tank of 25 000-unit capacity with one pipe of 100-unit capacity connected, there will be 12 500 units in the storage tank and 50 units in the pipe, both being filled to the same percentage (50%) of their capacities, even though the amounts themselves are obviously unequal.

Pumps separate these vessels. As long as you have at your fluid loading station
- separated by a pump from the fluid system that fills the station (so that the station is a separate vessel)
- all pipes and tanks not separated by a pump (so that the station is one (1) vessel)
- the incoming amount of fluid is high enough to satisfy the demand (Pumps can move 200 units of fluid per tick, or 12000 per second wiki, again)
- pipes, tanks and pumps are placed in a way that fluids are pumped out of the system equally
then all of its units (each single pipe and tank) will have (nearly) exact the same percentage of fluid. => Every tank contains (nearly) the same amount of fuel.

As long as the tank wagons are equally filled when the train enters the train station, all tank wagons will be equally filled at (nearly) the same time.
Attachments
This station is NOT able to satisfy the demand. (1 pump 1, 4 pumps out | indirect in, direct out)
This station is NOT able to satisfy the demand. (1 pump 1, 4 pumps out | indirect in, direct out)
fluid station.jpg (490.49 KiB) Viewed 7874 times
Post Reply

Return to “Combinator Creations”