Accumulator power indicator in vanilla

Post pictures and videos of your factories.
If possible, please post also the blueprints/maps of your creations!
For art/design etc. you can go to Fan Art.

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Accumulator power indicator in vanilla

Post by XKnight »

Recently, I was asked about accumulator power indicator, so this post is dedicated to this topic.
Obviously you can find some mod which will add this indicator to game or you can wait for several month until 0.13... But if you prefer vanilla game and don't want to wait so long - welcome aboard.

It is important to say that this indicator doesn't use anything "new" and it was possible to create it almost one year ago. Someone even said that my sensor is not a sensor at all, but this didn't stop me from using it :lol:

During last year this sensor was significant improved (now its creation process is much simpler, and it has higher accuracy), but idea remains the same...

Initial construction. Nothing special.
Stage1
Filling with water... It is important to fill tank with ~255 water units, because this value corresponds to accumulator capacity (accumulator is completely discharged in 5000/300 = 16.66 sec, and half-pump transfers 16.66*0.5*30 = 250 units during this time, 5 water units is left to fill other part of this system). The simplest way to fill this tank is to use pump with condition "water<255".
Stage2
Adding some stuff...
Stage3
Adding electricity networks, priority is very important. Main network (yellow) has priority 4.
Stage4
Last step before connecting to the main grid is to check that everything is working properly:
Hover you mouse over any pump inside WHITE network (marking is on the picture above) and write this command "/c game.player.print(game.player.selected.energy)": output should be 249.99999999965 or like this.

Unfortunately, this build is not perfect due to floating point errors in Factorio energy/flow simulation. For example if you leave it without main grid and check water amount in main tank you may see:
230.88554922131
230.88554922133
230.88554922134
230.88554922135
...
So, this build has some error and it is equal to 0,00000000001 water unit per second (or about this). In other words, if you play a single factorio game during 3170,9 years (without charging your accumulators to max level) you will receive 1 water unit error, which is about 0.4%. This is not so much :D
Accuracy of this measurement is also 1/250 = 0.4% (because signal always has integer value).

Interesting gif-example you may find here (it was some 3-month-ago-sensor, current version is the latest, but result is the same).
fun.png
fun.png (1.08 MiB) Viewed 11731 times
Explanation how and why this works I will post tomorrow.

Notes:
* Yes, I know that I've put too many boilers.
* Yes, it is possible to make wiring using only small poles, but this makes construction process more difficult.
* And yes, you may use radars + pumps or whatever you want unstead of this beacon, but result will be the same (at least while energy consumption is the same).
Last edited by XKnight on Tue Apr 05, 2016 8:09 am, edited 1 time in total.

Neotix
Filter Inserter
Filter Inserter
Posts: 599
Joined: Sat Nov 23, 2013 9:56 pm
Contact:

Re: Accumulator power indicator in vanilla

Post by Neotix »

Ha, I knew that someday, someone will find a use for this hidden feature (viewtopic.php?f=8&t=4814)

Entire sensor is very interesting especially ability to show charge level on numeric display.
I have some questions but I wait for explanation and probably I find the answers in it.

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Accumulator power indicator in vanilla

Post by XKnight »

I am going to start this explanation by proving that this system is stable.
It means that tank always has the same amount of water inside with disconnected main grid.
ex1_.png
ex1_.png (1.24 MiB) Viewed 11661 times
0: Everything starts from steam engine which produces 510 kW.
1: Because RED network (all marking you can find in stage4) has higher priority than GREEN, it receives 360kW (300kW to accumulator, and 2*30kW to small pumps).
2: Remaining energy (510-360=150kW) goes through GREEN network to the second accumulator.
3: BLUE network (with priority 3) transfers 300kW from the first accumulator to every machine within itself. This network has saturation level 300/1200=0.25 (available amount of energy divided by max consumption). As a result, a small pump in the yellow bar receives 30*0.25=7.5 kW from this network.
4: --This step is missed because main grid is disabled---
5: WHITE network transfers a piece of 150kW from the second accumulator (saturation level 150/600=0.25) to the small pump 30*0.25=7.5kW.
In total, small pump receives 7.5kW from BLUE network and 7.5kW from WHITE network = 15kW.
Because main tank is filled only with one pump (at full speed, 30kW) and is emptied with two pumps (15kW) water level remains the same.

Second example is a main grid that drains 100% of available power from all accumulators.
ex2_.png
ex2_.png (1.21 MiB) Viewed 11661 times
Here everything is the same, except 4 step: main grid (YELLOW) drains all energy from the second accumulator because it has has higher priority than WHITE network. As a result, small pump receives 7.5kW only from BLUE network and 0kW from WHITE. This leads to filling main tank with speed 30kW-2*7.5kW = 15kW.

Last example is a main grid that produces so many energy which is limited only by accumulator charging rate.
ex3_.png
ex3_.png (1.22 MiB) Viewed 11661 times
Here everything is the opposite: WHITE network transfers 300kW (150kW from steam and 150kW from main grid), saturation level is 300/600=0.5, and small pump receives 30*0.5=15kW.
Total amount of received energy is 7.5kW from BLUE and 15kW from WHITE = 22.5kW.
Сonsequently, main tank is emptied with 30kW-2*22.5kW = -15kW speed.

It is important to notice, that max filling speed should be equal to max empting speed for consistency reason.

Real example:
Imagine that you have 100 accumulators in main grid (with 5000kJ energy inside), and each of them is discharged with speed 30kW. What happens when we connect this sensor to the main grid? Because second accumulator became a part of this grid and has 150kW inside (from GREEN network) it will take part in energy distribution.
Some math
Now we know that accumulator in the main network is synchronized with tank. Thanks to this, while measuring amount of water we also measure amount of energy in the main network.

Later I will add funny gifs.

Notes:
* building additional accumulators in the main network may influence accuracy of this measurement until these accumulators will be synchronized with network. So it is recommended to a) add only fully charged accumulators to the 100% charged main grid; or b) ignore this measurement during expanding time. Personally I prefer b) :D
* hometask for everyone who read to this place: create high-accurate sensor for specified region, like energy level is 10..20% and accuracy is 0.04%.

yarekt
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Apr 05, 2016 11:33 pm
Contact:

Re: Accumulator power indicator in vanilla

Post by yarekt »

Only had a few minutes to try this out, here is my attempt:
Image

What seems to be happening is the right accu is always discharged. Makes sense, it is drained by pumps + beacon = 300kW, so even if its charged at 300kW all of its energy is going out straight away.

Network 4 is joined to my main network. I have a concern that since factorio joins networks by renaming the smallest network to the larger network's ID the Yellow network is actually getting a lower ID, one that was assigned when I built my first electric pole. Does this make sense?

Edit: I'm going to give this another go after some sleep time, tracing the power usage exactly by your description, XKnight. I'm positive that I have something incorrectly connected
Last edited by daniel34 on Wed Apr 06, 2016 2:49 am, edited 2 times in total.
Reason: included image link, OP was not allowed to post links

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Accumulator power indicator in vanilla

Post by XKnight »

As I promised,

Here is something funny:
1.png
1.png (933.33 KiB) Viewed 11443 times
Simple charging
Something more interesting

yarekt
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Apr 05, 2016 11:33 pm
Contact:

Re: Accumulator power indicator in vanilla

Post by yarekt »

Right, I had a good go at it tonight. I'm pleased to report that it works exactly as advertised, with one caveat.

I tested it with 1 accumulator, and 6, result was the same once they synchronised.Image

Connecting the Yellow Network 4 to the main grid breaks the detector.
Connected to the main network on the right
I assume that to make this work I will have to tear up and rebuild my main power network, to ensure it stays the same ID. Or create a dummy network out of Yellow Network 4 to be bigger than the main network, and then join them together, having factorio pick Network 4 as the winner.

Am I missing something ?

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Accumulator power indicator in vanilla

Post by XKnight »

yarekt wrote: I assume that to make this work I will have to tear up and rebuild my main power network, to ensure it stays the same ID. Or create a dummy network out of Yellow Network 4 to be bigger than the main network, and then join them together, having factorio pick Network 4 as the winner.
Indeed, probably I forgot to mention this important thing, because first time it happened with me accidentally.
Solution is simple: at first you should separate your main network into three approximately equal zones, lets say: A, B, C.
Only one zone will receive parent id (the biggest zone, lets say A).
B and C zones can be easily identified because they don't have any history in energy consumption/production screen.
After that you should merge zones B and C into one single network (lets say D).
Obviously, network D is bigger than A, so A will be destroyed after merging with D.
Finally you will have a single network D with the lowest priority on the map.

P.S. In fact, you can build sensor which will work only if main network has the highest priority. But I think you can figure out it by youself :)

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Accumulator power indicator in vanilla

Post by ssilk »

I like such good explanations, with gifs etc. Much work...
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Guu
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Sun Feb 28, 2016 5:59 pm
Contact:

Re: Accumulator power indicator in vanilla

Post by Guu »

I also developed a battery charge sensor. it is much easier and responds to discharge pre- designated value .
it consists of several electric poles and then something that consumes energy for example three manipulator

Post Reply

Return to “Show your Creations”