A critique of Factorio’s power generation systems

Post all other topics which do not belong to any other category.
mrvn
Smart Inserter
Smart Inserter
Posts: 4484
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by mrvn »

Qon wrote:
Wed Aug 05, 2020 8:05 am
mrvn wrote:
Tue Aug 04, 2020 3:21 pm
I wish there were a entity that would allow directing the flow of energy. Both the input and output terminal should have a priority setting.

So for example I want to take power from the emergency steam engines (so input priority high enough to draw from steam engines) and supply it to the network but only for laser turrets (output priority low enough so only laser turrets draw from it).
This seems pretty cool, and also pretty moddable. I think Transformers does exactly this.
Edit: with some edit maybe: https://mods.factorio.com/mod/Transform ... 0009d723bd
Transformers are just a pair of electric boiler and steam turbine. There is no priority adjustment there. If anything draws power from the output then the input will consume electricity as the assembler level. No way to make it only take electricity if there is an excess for example, or only from solar cells.

Qon
Smart Inserter
Smart Inserter
Posts: 1633
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by Qon »

you could change the
usage_priority under energy_source of "trafo-target-"..i.."-sw" AND "trafo-target-"..i.."-ne" (in data.lua)
to "primary-output".
mrvn wrote:
Wed Aug 05, 2020 2:41 pm
Qon wrote:
Wed Aug 05, 2020 8:05 am
Edit: with some edit maybe: https://mods.factorio.com/mod/Transform ... 0009d723bd
Transformers are just a pair of electric boiler and steam turbine. There is no priority adjustment there. If anything draws power from the output then the input will consume electricity as the assembler level. No way to make it only take electricity if there is an excess for example, or only from solar cells.
I'm assuming it can be modified to have another input priority as well. And if you do both then you would have what you need, right? I guess it's flow limited, but it could be changed to have a higher throughput capacity and you can place more of them.

mrvn
Smart Inserter
Smart Inserter
Posts: 4484
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by mrvn »

Qon wrote:
Wed Aug 05, 2020 7:58 pm
you could change the
usage_priority under energy_source of "trafo-target-"..i.."-sw" AND "trafo-target-"..i.."-ne" (in data.lua)
to "primary-output".
mrvn wrote:
Wed Aug 05, 2020 2:41 pm
Qon wrote:
Wed Aug 05, 2020 8:05 am
Edit: with some edit maybe: https://mods.factorio.com/mod/Transform ... 0009d723bd
Transformers are just a pair of electric boiler and steam turbine. There is no priority adjustment there. If anything draws power from the output then the input will consume electricity as the assembler level. No way to make it only take electricity if there is an excess for example, or only from solar cells.
I'm assuming it can be modified to have another input priority as well. And if you do both then you would have what you need, right? I guess it's flow limited, but it could be changed to have a higher throughput capacity and you can place more of them.
And that's I think where the game is still lacking. With the priority being hardcoded and not selectable by the prototype (or at runtime).

As for the flow limit: For transformers it depends on the speed of the entities and fuel value of the transfer liquid. So that part is tuneable. Problem there is you can't set the speed too high because flow through pipes is limited. And you can't set the fuel value to high because you need a certain amount of flow or the power transfere will become noticable discrete (as in: it first collects 1GJ of energy over 10 minutes while outputing nothing and then it can output 1GJ at up to 1GW/s before going dead again).

Overall it is a hack for something the game could solve better.

Moo Rhy
Inserter
Inserter
Posts: 25
Joined: Sun Dec 04, 2016 7:29 pm
Contact:

Re: A critique of Factorio’s power generation systems

Post by Moo Rhy »

I often cogitated about how to make the electric power grid in Factorio more realistic. Currently it's a "copper plate" model. Any physical properties and limitations of the lines are completely neglected. Only input and output need to be balanced. In reality it's much more difficult of course. You must consider congestions due to current limitations, stay within the voltage limits and avoid instabilities.

The problem is nothing of these can be properly simulated without real time load flow calculations (whose complexity is at least N², as already mentioned). At least I don't know how. Of course you can simplify the network. But this has to be done each time anything within the network topology changes and if it's only an opening switch. I guess this would lead to heavy lagging on bigger factories. So we can completely forget about load flow calculation because it's just not applicable due to its high computational resource demand.


One other aspect why a load flow based grid model with losses might be problematic is the current way Factorio handles the voltage-power-characteristic of loads. It is a constant current-like behavior. This means all machines drain a constant current all the time. Power is regulated linearly by changing the voltage as P=U*I. So how does it work exactly? Generators in Factorio normaly output exactly the demanded current at a constant voltage up to their maximum power which equals a maximum current. If the maximum power is exceeded the generator keeps the power constant and reduces the voltage. The lower voltage reduces the power demand so that it matches the maximum generator power. The current stays the same.
Example: You have a generator with a rated power of 1000 kW at 10000 V and 100 A. Now you connect a load with 800 kW. As the power is below the rated generator power it outputs its rated voltage of 10000 V. A current of 80 A flows.
Now you connect a second 800 kW load. The total load exceeds the generator power. They try to drain a current of 160 A. The generator now reduces the voltage to U=P/I=1000 kW / 160 A = 6250 V. The loads drain their nominal current and the generator delivers its rated power.

Now the problem is that in a grid with losses the voltage drops from the generator along the line to the last load. In Factorio this means that machines at every pole would get a different voltage and have a different working speed that depends on the power demand along the line. Calculating and balancing production would be impossible.
The solution to this would be a voltage independent behavior like in reality. Every device with a regulated power supply like electronic devices or motors with converters are voltage independent. They drain exactly the power they need as they convert the incoming fluctuating voltage to a different constant voltage. Transformers with tap changers also keep the voltage on the secondary side constant. Induction and synchronous motors are voltage independent as they simply drain more current as the voltage goes down.
The problem with this behavior is that the system suddenly collapses when the power demand exceeds the maximum generation. Losses on lines lead to low voltages at the end of the line. A transformer with tap changer will change its transmission ratio to keep the secondary voltage up. This leads to a higher current which leads to higher losses in the line which leads to a lower voltage which will make the transformer change its ratio again which increases the current which increases losses and so on until everything collapses (this was the cause of many blackouts for example Greece in 2004). This unstable behavior is undesirable for Factorio because there's hardly any way to identify an evolving collapse until it's too late. Especially as the fast control speed means that the collapse will happen instantly. And the only way to recover is by disconnecting parts of the grid and installing more generators.


The only thing I consider possible is a constant loss aka power demand of every pole. Bigger poles have a lower demand and wider span (which reduces losses further) thus are the choice for long distance transmission.

seasonedsalt
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Aug 18, 2020 11:32 am
Contact:

Re: A critique of Factorio’s power generation systems

Post by seasonedsalt »

My current complain on the power source would be there only 3 option to make power,and 2 of them is basically same (steam) :roll:

There is another issues the first time I play,I cannot find a natural gas/oil power plant,I understand they are boiling water in the end.
But I could upgrade that 165C boiler with higher temperature(less footprint),a multiple stage steam turbine would be a good addition.Something 300C then drop to 125C,you could choose to reheat it back to 165C/300C.

Post Reply

Return to “General discussion”