Hello and thank you for reading and helping! I have chunk of hours and slowly learning all the circuits and just how much fun it is to make things work when you want. My question is when clicking turbines(nuclear), you can see the output bar of 25 out of 60 or clicking a power pole and seeing the green bar hovering just before mid way, is it possible to place a visual indicator, using lights, to show from 0-100% of power usage? I found this blueprint here, https://factorioprints.com/view/-KpeF8NpY6pGFoiKyXLD, and was wondering, can the power grid usage be read to convert it into a visual product like this?
I already set up lights to visually tell me product totals in storage boxes and love it, I would like to see my power usage incase I am maxing out aka im cheap and dont want too much nuclear power and as I grow the base and see i need power, I add as i go.
Thanks Again!
Visual Power Usage
-
- Manual Inserter
- Posts: 1
- Joined: Mon Jul 17, 2017 3:33 am
- Contact:
-
- Filter Inserter
- Posts: 947
- Joined: Wed Nov 25, 2015 11:44 am
- Contact:
Re: Visual Power Usage
I don't think this is possible trivial. You can read the charge of an accu but you can't read total power production or consumption.
A workaround could be to monitor fuel intake. Since the nuclear fuel lasts very long, what you could do is add a secondary coal power plant (with 1-10 boilers) and count how much wood is inserted per second (assuming an infinite supply of wood), and divide that by the theoretical wood usage per second. This would also be a good sink for all the wood you are accumulating
If you can measure fluid throughput you can also check the flow of water or steam, which should be a proxy for nuclear power generation. Maybe you can isolate one turbine behind a steam tank and pump set to pump if steam < X. Then, you can count how many seconds the pump is active and calibrate that?
[if what you really want is a "power low alert", that should be much easier since an accu will only drain if the normal power plant cannot handle the load. So, you could build a modest accu bank (or just a single accu) and than link the accu to a speaker set to give an alert if the accu is not fully charged.]
A workaround could be to monitor fuel intake. Since the nuclear fuel lasts very long, what you could do is add a secondary coal power plant (with 1-10 boilers) and count how much wood is inserted per second (assuming an infinite supply of wood), and divide that by the theoretical wood usage per second. This would also be a good sink for all the wood you are accumulating

If you can measure fluid throughput you can also check the flow of water or steam, which should be a proxy for nuclear power generation. Maybe you can isolate one turbine behind a steam tank and pump set to pump if steam < X. Then, you can count how many seconds the pump is active and calibrate that?
[if what you really want is a "power low alert", that should be much easier since an accu will only drain if the normal power plant cannot handle the load. So, you could build a modest accu bank (or just a single accu) and than link the accu to a speaker set to give an alert if the accu is not fully charged.]
-
- Filter Inserter
- Posts: 947
- Joined: Wed Nov 25, 2015 11:44 am
- Contact:
Re: Visual Power Usage
Here you go 

It turns out that a pump in front of a steam tank + turbine can indeed be used to measure power use.
Two steam turbines consume 120 steam/s. A pump can pump 12000 steam/s, so under 100% load the pump will be active 1% of the time. You can't measure whether a pump is active, but by setting the pump to [steam < 1k] and measuring whther the tank has <1k you get a signal whenever the pump is active. I want 100% power to be the signal 100, and 100% power means a signal 1% of the time, I emit 100*100=10k whenever steam < 1k:

This is input as signal V on a moving average (viewtopic.php?f=193&t=51471; thanks to BlakeMW / siggyboy), since you need to smooth the 10k every 100 ticks into an average of 100. I set the smoothing factor to 1000 so it takes a couple seconds to register a power level change, but with a lower smoothing it fluctuates pretty badly.
Note that the first tank and pump are there to make sure that there is a full input for the measured pump, otherwise it can give wrong readings.
Full load:

Half load:

Low load: (this fluctuates really badly as the signal is zero for a couple seconds at a time)



It turns out that a pump in front of a steam tank + turbine can indeed be used to measure power use.
Two steam turbines consume 120 steam/s. A pump can pump 12000 steam/s, so under 100% load the pump will be active 1% of the time. You can't measure whether a pump is active, but by setting the pump to [steam < 1k] and measuring whther the tank has <1k you get a signal whenever the pump is active. I want 100% power to be the signal 100, and 100% power means a signal 1% of the time, I emit 100*100=10k whenever steam < 1k:

This is input as signal V on a moving average (viewtopic.php?f=193&t=51471; thanks to BlakeMW / siggyboy), since you need to smooth the 10k every 100 ticks into an average of 100. I set the smoothing factor to 1000 so it takes a couple seconds to register a power level change, but with a lower smoothing it fluctuates pretty badly.
Note that the first tank and pump are there to make sure that there is a full input for the measured pump, otherwise it can give wrong readings.
Full load:

Half load:

Low load: (this fluctuates really badly as the signal is zero for a couple seconds at a time)

blueprint
Re: Visual Power Usage
If you wanted it to fluctuate less, couldn't you average the load over a few ticks or even seconds?
There are 10 types of people: those who get this joke and those who don't.
-
- Filter Inserter
- Posts: 947
- Joined: Wed Nov 25, 2015 11:44 am
- Contact:
Re: Visual Power Usage
Yeah that's exactly what I do by taking an exponential moving average. However, with 10% usage you have 1 tick pumping every 1000 ticks, so even if you would average over 15 seconds you still get fluctuations...Jap2.0 wrote:If you wanted it to fluctuate less, couldn't you average the load over a few ticks or even seconds?
Re: Visual Power Usage
Ah.
There are 10 types of people: those who get this joke and those who don't.