Page 1 of 1

[0.17.79] Overlapping electric networks can cause increased power draw

Posted: Thu Jan 02, 2020 2:10 pm
by Meddleman
So quite the wordy title, I wasn't sure how to formulate it concisively.

tl;dr - An electrical consumer, ie. a lamp, connected to multiple seperate electric networks (by means of coverage-overlap) will multiply the effective draw from an electrical supply, ie. turbine according the number of electric networks.

So in my bid to build a simple substation+akku regulator (like a flow limiter found on a gas-cylinder) I stumbled upon this curious issue:
Regulator - Both Substations - comb..jpg
Regulator - Both Substations - comb..jpg (675.5 KiB) Viewed 4140 times
As you can see, the 16x5kW lamps should, by all logical rights, only require a total of 80kW from its primary source, the Steam Turbine, however it is clearly having to supply 160kW.

Details

Re: [?] Overlapping electric networks can cause increased power draw

Posted: Thu Jan 02, 2020 3:02 pm
by Loewchen
What version of the game is that?

Re: [?] Overlapping electric networks can cause increased power draw

Posted: Thu Jan 02, 2020 4:03 pm
by Meddleman
Loewchen wrote: Thu Jan 02, 2020 3:02 pm What version of the game is that?
17.79, Steam is set to "17.x Latest 0.17 Experimental".... yikes, forgot that in the title.

EDIT: Thanks for the thread cleanup, my bad, that I gotta work on.
A certain image was out of order, namely the mouse-over of an un-accu'd turbine network, which I didn't managed to squeeze in on time, but it'd be gratuitous at this point, and easy to self-duplicate.

Re: [0.17.79] Overlapping electric networks can cause increased power draw

Posted: Fri Jan 03, 2020 1:08 am
by TruePikachu
I think this might be caused by lamps being merged together with respect to the interface to the electric network. If you have three groups of lamps, with 2, 3, and 4 lamps, and two electric networks, where the first sees the 2 and 3 groups while the second sees the 3 and 4 groups, the lamps virtualize into a group of 5 lamps on the first network and a group of 7 on the second. Powering these together (connecting networks with e.g. an accumulator bridge) requires power for 12 lamps, despite there only being 9; the shared group of 3 is getting double consumption.

The only method I can think of right now that would "fix" it is to change the virtualization to, instead of being strictly per-network, be per-networks-present-in. What I mean is that the group of 2 lamps would be virtualized together (only present in the first network), the group of 4 would be virtualized together (only present in the second network), and the group of 3 would be virtualized together (present in both networks). A similar technique could also be used with solar panels, which I'd bet are also affected by this issue for similar reasons.
EDIT: Solar is not affected by this issue, going by a simple test I ran.

Re: [0.17.79] Overlapping electric networks can cause increased power draw [with lamps]

Posted: Fri Jan 03, 2020 1:17 am
by Squelch
I am able to confirm this, and have found it is not the overlapping power networks per se, but just the lamps within overlapping power networks that cause the issue.

I too use the overlapping or adjacent power network together with accumulators as a passive method of regulating my standby power, and have not experienced this particular problem. However, I was intrigued by this report and attempted to reproduce it using a variety of power consumers that draw power from adjacent or overlapping power grids. All other entities except one do behave as expected - ie they will draw power from one or more networks to satisfy their needs, and no more. One of the individual power sources will supply power up to its capacity, and the other networks will then supply the remainder. (As an aside, they do not share the load equally)

Lamps however, advertise as having a total consumption of 5KW, and this is confirmed when connected to a single power network. However, when they are connected to more than one power network via the pole footprint, they will apparently draw 5KW from each for a total of the number of power networks that they share a footprint with. Eg. a single lamp that is covered by 4 different networks will draw 5KW from each for a total of 20KW.

Reproduction steps:
  1. Start a new Sandbox game.
  2. Enable full research and cheats when prompted.
  3. Import the attached blueprint book.
  4. Select the Assembler example BP and use the picker (Q) to place each of the entities (Note the infinity pipes for steam)
  5. Select copper cable from the inventory and "connect-to-isolate" the 4 networks from each other at the 4 centre poles (workaround for BP autoconnect) See wiring guide image below.
  6. Turn on each of the power switches to observe and confirm that the consumption reported at each of the 4 poles is correct and the total standby power for that building is not exceeded.
  7. Now select the Lamp example BP and repeat the steps above.
  8. Use the constant combinators to select the inner (signal I) group covered by all four networks, or the outer group (signal O) where each of the four lamps is connected to only two networks.
Observations:
  1. The assembler, or any other building that is placed within the overlapping power pole footprints will draw only the standby power (12.5KW from one of the available networks), or the maximum power while active. Never more, and only up to the total from all available power networks. By using the power switches, each network can be isolated, and will confirm that a total of the advertised power consumption is only ever drawn from one supply.
  2. The lamps will draw 5KW each while active. The two constant combinators control the inner and outer groups as signals I and O respectively. Measuring the power draw at each of the four central poles, it will be seen that for each network that has one or more lamps within its footprint or area of effect. The inner group will draw 25KW, and the outer group will draw 10KW at each pole for each pair.
    • It will be noted that when all power switches are active, and the inner group only illuminated. 25KW will be seen at each pole indicating that 25KW is being drawn from that supply. This is confirmed by consulting the power output at the generator.
    • The total power drawn from all four supplies is therefore 100KW, not 25KW as expected.
    • Isolating each of the supplies will still show 25KW at each of the "live" poles, and again confirmed at the relevant generator.
    • With all power switches active and the outer group only illuminated, the measured power draw at each pole is 10KW for the two lamps within each power pole's footprint.
    • The total power draw from all supplies is therefore 40KW, not 20KW as expected.
    • Activating all power switches and combinators to illuminate all lamps shows that each pole is supplying 35KW for a total of 140KW, not 45KW as expected.
wiring guide

Re: [0.17.79] Overlapping electric networks can cause increased power draw

Posted: Fri Jan 03, 2020 1:22 am
by Squelch
TruePikachu wrote: Fri Jan 03, 2020 1:08 am I think this might be caused by lamps being merged together with respect to the interface to the electric network. If you have three groups of lamps, with 2, 3, and 4 lamps, and two electric networks, where the first sees the 2 and 3 groups while the second sees the 3 and 4 groups, the lamps virtualize into a group of 5 lamps on the first network and a group of 7 on the second. Powering these together (connecting networks with e.g. an accumulator bridge) requires power for 12 lamps, despite there only being 9; the shared group of 3 is getting double consumption.
...
EDIT: Solar is not affected by this issue, going by a simple test I ran.
You just beat me to posting my tome :)
My thought was that it might only affect entities, such as single cell lamps, that are completely enclosed within a footprint. I can report that inserters, and combinators are also free from this problem. I couldn't think of any other small entities that consume power.

Re: [0.17.79] Overlapping electric networks can cause increased power draw

Posted: Tue Aug 04, 2020 6:31 pm
by boskid
Looking into the code it looks this is intended simplification made to reduce performance impact of the lamps. They do not work as regular consumers but are counted on a per-network base (in case of multiple electric network they are registered to all of them) and then on the electric sub network level the lamp satisfaction is computed once for all lamp then lamps when rendered use highest satisfaction from all sub networks it is connected. Since it cannot be abused (as it could happen with solar panels if their power output would be multiplied) i am not considering this to be worth fixing. Fixing this would require grouping lamps into sets with the same set of subnetworks around and then sub networks would have to go through all of the lamp sets to compute satisfaction for all of them. It is not important at all.