Add signal to read pump flow rate

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Mazzelfassel
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Dec 04, 2015 11:39 pm
Contact:

Add signal to read pump flow rate

Post by Mazzelfassel »

Since the release of 2.0, you can create fluid bus systems that allow multiple fluids to be pumped through a single pipe. This makes it possible to have train stations that supply a variety of fluids.

The problem with this is that if you are supplying multiple fluids through the same pump(s) to fill a train tank, you need to prevent residual fluids in the network. The solution to this is to not fill the tank completely, allowing the pump to drain itself and the network before the train departs. Since you cannot read the level of an individual train tank, you have to read the whole train.
But there is a problem: if you try to fill multiple tanks at once, and there are fewer pumps delivering fluid to the bus than there are pumps filling the tanks, the fluid will be distributed randomly (or at least unevenly). The result is that some tanks are completely filled, leaving residual fluid in the pump, which then causes a blockage when the next rain comes.

A simple solution would be to read the flow rate of a pump (which is already part of the tooltip), which in turn allows you to calculate the amount of fluid being pumped (like using a memory cell). This would allow you to turn off the pump when the target amount in the tank is reached.
eugenekay
Filter Inserter
Filter Inserter
Posts: 496
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Add signal to read pump flow rate

Post by eugenekay »

Sorry, what? Multiple fluids in one pipeline, and adding more circuits to make it work, is not “a simple solution”. The game provides lots of clues that you should not mix fluids, it even provides a way to manually Void fluids that have been mixed. Your proposed solution would never work, as the Factorio Signal network operates on Integers - but the fluid system is Float based. So there would not be a way to detect “0.111111 remaining” in the pipe…


If you want Fluids to be simple then don’t design your Pipeline systems to mix Fluids. Simple!


-Eugene
Mazzelfassel
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Dec 04, 2015 11:39 pm
Contact:

Re: Add signal to read pump flow rate

Post by Mazzelfassel »

The "simple solution" refers to exposing an already existing value as a signal, i.e. the "pumping speed" of a pump. Everything else is just a description of a use case for said signal.

It also depends on interpretation whether you could call what I described "mixing fluids", because at any given time there is only one fluid in the pipe system. It's just that several pipe networks "share" one part.

Of course, I could create a simple solution by creating a separate station for each fluid, but that would take up many times more space.
eugenekay
Filter Inserter
Filter Inserter
Posts: 496
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Add signal to read pump flow rate

Post by eugenekay »

That can be done with existing mechanics. You can place multiple Train Stops next to each other to save space. En/disable the correct Pump depending upon which Train Stop is outputting a Signal. No fluid mixing or memory cells required.

Good Luck!
Mazzelfassel
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Dec 04, 2015 11:39 pm
Contact:

Re: Add signal to read pump flow rate

Post by Mazzelfassel »

That still results in multiple train stations. If you want to provide like 10 fluids you would still require lots of space. Also I'm using Project Cybersyn so placing multiple stations so close to each other leads to other issues.

My whole reason for suggesting this feature is actually because recently they added a way to reserve wagon space for fluid trains, similar to how it is done with items.
User avatar
Khazul
Fast Inserter
Fast Inserter
Posts: 202
Joined: Fri Sep 03, 2021 4:47 am
Contact:

Re: Add signal to read pump flow rate

Post by Khazul »

If you want multi-fluids in a pipe, then you need a means to pump the excess back. I generally do this with filtered reverse pumps back to a fluid buffer tank that is enabled when a selected forward (from specific tank to generic consumer - trains factory whatever) is not. Of course for this to work, you need to have space in the tank to pump excess back in.

I have used this a lot for recipe switching in production machines that can consume and produce fluids (foundry for eg) and it works fine. Downside is the space it takes for the buffer tanks, pumps etc.

Reading flow rate is useful and there have been many times I have wished this was possible, however never to help for switching fluids as I have always pumped the excess back.

You could probably assume a flow rate through a pump based on info in the wiki when the source and destination are effectively tanks and the source is known to have sufficient in it. 1200 units/sec for a normal pump, so 20 units per game tick (1/60th second). Count ticks * 20 to get total amount over a time.
Mazzelfassel
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Dec 04, 2015 11:39 pm
Contact:

Re: Add signal to read pump flow rate

Post by Mazzelfassel »

The whole idea of the setup I described above is not to fill the target tank completely, allowing the pipes and pumps to empty themselves. So adding a buffer tank to drain the system would go against the idea.

As for calculating the flow rate, I have done some tests. The pump runs at full speed when the tank is more than 40% full. If it is less than that, the speed seems to decrease linearly. So to calculate the flow rate you would need to do some complex combinator math. In addition, if you have more than one pump connected to the tank and want to calculate the flow rate for them separately (which is essentially what I am trying to do), the values for each pump will differ slightly, increasing the overall error with each tick.
image.PNG
image.PNG (217.77 KiB) Viewed 313 times
Post Reply

Return to “Ideas and Suggestions”