Power controller for mixing solar with steam/nuclear power

Power Plants, Energy Storage and Reliable Energy Supply. All about efficient energy production. Turning parts of your factory off. Reliable and self-repairing energy.
mrvn
Smart Inserter
Smart Inserter
Posts: 5703
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Power controller for mixing solar with steam/nuclear power

Post by mrvn »

When you don't have enough solar panels and accumulator to run your factory 24/7 you have to supplement power with steam engines or nuclear.

But if you just connect them then steam/nuclear power is used to charge the accumulators. Which makes them basically pointless. You might as well just power the base all night with steam/nuclear for the same fuel consumption.

There are some simple circuits that detect when the accumulators are low and when the sun is rising. But I can't remember any that detect when solar panels produce just enough to power the whole base and don't charge accumulators from steam/nuclear. So I made one:
power-overview.png
power-overview.png (4.61 MiB) Viewed 4940 times
At the left I have solar panels and radars to simulate the electrical consumers. At the bottom are accumulators. It's important that they do not connect to anything but the switch in the controller. Similar on the right are steam engines that must connect only to the other switch in the controller.

Note that the power controller sits between the boilers and the steam engines. The controller needs to measure steam being used accurately. That only works if 1 unit of steam is used over 9 ticks, which comes to about 225kW. That is 225kW over what solar panels provide. You don't have to route all your steam through the power controller but the more the better it works.
power-control.png
power-control.png (2.49 MiB) Viewed 4940 times
The controller has a lot of combinators but it's quite simple. At the top the pumps and the left fish loop manage the steam tanks. One if always getting filled and one is getting drained. The fish is used to switch all 4 pumps in the same tick so there is always steam available to the steam engines.

Each tank then has 2 combinators attached, one turns the steam signal into water to create a 1 tick delay, the other subtracts steam from water to signal the change in steam level in the tank. For each that is then filtered for steam > 0 to only report used steam and not the refill.

Then at the bottom are a bunch of combinators each + 0 = each that simply delay the signals and all flow into a final decider combinator on the right that outputs 1 steam if steam > 0, i.e. if any steam was used in the last 9 ticks. All this so far is just to measure if steam is being used or not.

Now comes the power control: Again a fish loop is used, this time to eliminate fluttering of the power switches. The fish is removed from the chest when the accumulators are below 2. This turns on the steam engines. I assume that 1% charge is enough to run the base for 1 tick. You can increase the trigger if not, but really what is the point of the accumulators if they don't hold at least 100 ticks worth of power. This will also disconnects the accumulators so they don't recharge from the steam engines.

Then when the sun rises the solar panels will slowly take over power production and less and less steam is used. When steam usage drops below 1 steam per 9 ticks for a while (you can see the inserter stutter a bit if you watch closely, it needs quite a few ticks without steam signals to pick up the fish) the fish is put back into the chest. This will turn of the steam engines. The accumulators on the other hand already connect when the inserter holds the fish. This means that for ~0.1s the accumulators charge from the solar panels and steam engines. This gives them a little boost to give them a charge of >= 2. Without the boost the fish would get removed and make another loop (or two or three).

Here is how it looks in the power graph:
power-graph.png
power-graph.png (108.24 KiB) Viewed 4940 times
Other than that little spike for the initial boost the accumulators are charged only via solar panels, maximizing the fuel savings.

Note: Since solar and accumulators provide most of the power for the base the actual steam used on average is low. You can run a small number of boilers 24/7 and store the steam and then power a large number of steam engines or turbines for the short times they are needed. With just solar panels one boiler can power 6 steam engines. With more solar panels and accumulators this goes towards infinity (if you have enough the steam never runs). On the other hand if you power demands rise the ratio can go the other way. But then the accumulators will be pointless and remain uncharged and unused. Start with a 1:6 ratio and then add more steam engines in parallel with accumulators. A 1:20 or 1:30 ratio is totally reasonable.

Caveats:

1) If you don't have enough solar panels then steam will run all the time and the accumulators will never be used. But that is a stable setup and won't cause brownouts (provided you produce enough steam). So start by building solar panels until steam turns off during the day and then some. No point adding any accumulators before that point.

2) At dusk the accumulators have to supplement the solar panels to power the base. At night they have to provide all the power. But accumulators have a limited throughput. They might not be able to provide enough power for the base even if they have a charge left. I think they would drain during dusk while you still have a mix of solar and accumulator power but that is untested. So you might get brownouts if you have enough accumulators to outlast the solar panels but not enough to power the whole base (throughput wise). At the moment I assume that can't happen but let me know if it does. The fix is to place more accumulators.

3) If you have a backout at night the controller will remain stuck in whatever state it is. Which would make it impossible to switch steam tanks or turn the steam engines on. You probably want some solar cells near the controller and make damn sure biters don't damage the controller.

4) Since steam is controlled by the pumps no steam flows without power. A brownout means the pumps may slow down and then the steam engines may not get enough steam and you have a death spiral. This should recover on it's own at sunrise. Still something to watch out for. The controller could be detached from the normal power and run on it's own set of solar panels and accumulators. At 75kW 2 solar panels and one accumulator should do.

What do you think? Is there a simpler way?
Attachments
power.zip
(2.94 MiB) Downloaded 72 times

oyunbagimlisi
Fast Inserter
Fast Inserter
Posts: 182
Joined: Mon Aug 31, 2020 10:09 pm
Contact:

Re: Power controller for mixing solar with steam/nuclear power

Post by oyunbagimlisi »

I may be missing something (not understanding) but I couldn't understand why it might be necessary. The power backed up by the batteries is never wasted. The thing is, it is necessary to activate these batteries at night. Other energy type(s) used in it remain connected to the power switch depending on the battery charge rate. For example, at 40% (charge) the nuclear power plant is activated, at 20% (charge) a system that activates the vapors can work well (without wastage)... Am I wrong?
viewtopic.php?f=33&t=105093
Beacon domain & Cable access area coloring (Color Tone variations)

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

Re: Power controller for mixing solar with steam/nuclear power

Post by mrvn »

Yes, you are wrong. You are wasting fuel.

Accumulators just store energy. As you say nothing is wasted there. But it matters where that energy comes from. With steam engine producing power costs fuel. If you then store that power in accumulators and later power assemblers from the accumulators that is the same as powering them directly from the steam engines. Same goes for nuclear power. It costs uranium and oil (for the sulphuric acid to mine it).

On the other hand Solar panels, once build, give you energy for free all day long. So the power you want to store in accumulators is solar power. Otherwise you would waste free power and pay for it with fuel.

Tertius
Filter Inserter
Filter Inserter
Posts: 667
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Power controller for mixing solar with steam/nuclear power

Post by Tertius »

@oyunbagimlisi
If the accumulators get empty at night and you switch on some power plant, you need to disconnect the accumulators to avoid loading the accumulators with the power plant. If you allow charging the accumulators by the power plant, you waste the solar energy at day, since the accumulators are already filled.

At day, if the solar panels give more power than the factory consumes, the surplus goes into accumulators. If the surplus is less than the maximum loading rate of the accumulators, and you have a power plant connected, this difference is provided by the power plant. This way the accumulators fill earlier than necessary, with power from the power plant. For example the accumulators get full at noon, and the solar power surplus from noon to evening is wasted.

This means, in general you need to disconnect the accumulators as long as the power plant is connected.
You need to connect the power plant only, if the accumulators are empty.

Logic flow if you were able to compare power supply with power demand and were able to make a decision based on that:

if accumulator charge > 0 or solar power supply > factory power demand, then:
connect accumulators to power grid
disconnect power plant from power grid
else: (accumulator charge is 0)
connect power plant
disconnect accumulators

The crucial thing is to compare solar power supply with factory power demand: that's not directly possible. We only know solar power has priority above power from power plants, so power plants will cease power production if solar power is high enough to completely power the factory.

So we need to measure if the power plant is actually producing power. If it is actually producing power, the condition "solar power supply > factory power demand" is false, and it isn't actually producing power, the condition "solar power supply > factory power demand" is true.

Everything is about finding out if a power plant is really producing power, which isn't too easy. It boils down to the question if a steam engine or steam turbine drains a filled steam tank that is disconnected from steam supply, or if the steam level in the tank stays the same. If the steam level stays the same, the power plant doesn't produce power, so "solar power supply > factory power demand" is true.

For boilers and steam engines, the detection is not too difficult (and the thread tries to provide a solution), but for nuclear power plants it's even a bit more difficult, because you usually have an elaborated steam flow and steam turbine setup that is driven actively with pumps. Usually, you have dozens of turbines, multiple saturated pipes, and taking one as representative for all is very difficult.
On the other hand, one might say that if you have nuclear power, you don't care for wasting energy, because you have quasi infinite.


To the OP:
My phantasy produces the following trial.
Judge: Engineer, why did the power plant fail, so the whole city was without power over the night?
Engineer: The fish jumped off the belt.


Real:
I find your combinator setup a bit too complex. I bet it's possible to make it more easy. I did a similar thing in the past with detecting if a laser turret is currently firing by looking at its power consumption. As far as I remember, I needed 1 accumulator, 2 decider combinators and 3 power switches. The steam equivalents of these are 1 steam tank, 2 combinators and 3 pumps. I have to think about this if it's really that easy.

I imagine reading the tank volume, multiply with -1 (this gets 1 tick delay) and add to the current tank volume. If the difference is < 0, the tank volume lowered, so the plant is producing power. This condition resets a timer to 0 (timer/counter built with a decider combinator). As long as the timer value is < threshold1, the plant is considered as producing power. if timer value < threshold2 (smaller than threshold 1), a pump is activated to fill the tank. If the tank volume is full enough, the pump is switched off and the cycle starts again. While filling, power from the steam engine behind the tank should be disconnected, otherwise filling the tank takes too long.
For this, we only need to branch off a small bit of steam and a separate steam engine/turbine. It's only for measurement, not really part of the main power plant.

Your solution seems only suited for small power plants. You funnel the whole steam production through the detection installation. That's not feasible for larger power plants, especially for nuclear power plants.

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

Re: Power controller for mixing solar with steam/nuclear power

Post by mrvn »

Tertius wrote:
Sun Sep 04, 2022 1:22 am
To the OP:
My phantasy produces the following trial.
Judge: Engineer, why did the power plant fail, so the whole city was without power over the night?
Engineer: The fish jumped from the belt.
lol
Tertius wrote:
Sun Sep 04, 2022 1:22 am

Real:
I find your combinator setup a bit too complex. I bet it's possible to make it more easy. I did a similar thing in the past with detecting if a laser turret is currently firing by looking at its power consumption. As far as I remember, I needed 1 accumulator, 2 decider combinators and 3 power switches. The steam equivalents of these are 1 steam tank, 2 combinators and 3 pumps. I have to think about this if it's really that easy.

I imagine reading the tank volume, multiply with -1 (this gets 1 tick delay) and add to the current tank volume. If the difference is < 0, the tank volume lowered, so the plant is producing power. This condition resets a timer to 0 (timer/counter built with a decider combinator). As long as the timer value is < threshold1, the plant is considered as producing power. if timer value < threshold2 (smaller than threshold 1), a pump is activated to fill the tank. If the tank volume is full enough, the pump is switched off and the cycle starts again. While filling, power from the steam engine behind the tank should be disconnected, otherwise filling the tank takes too long.
For this, we only need to branch off a small bit of steam and a separate steam engine/turbine. It's only for measurement, not really part of the main power plant.

Your solution seems only suited for small power plants. You funnel the whole steam production through the detection installation. That's not feasible for larger power plants, especially for nuclear power plants.
Good catch on using multiply by -1 for the delay. Adding the signals is then just a matter of connecting 2 wires to the same decider combinator. So that saves 2 arithmetic combinators.

I give the idea of using timer instead of the chain of combinators for a delay a shot. That seems indeed better and the threshold1 could be provided by a constant combinator so it's easily tuneable.

I don't like the idea of threshold2 though. That would leave the steam engines without steam supply for a time. And when the plant is running full tilt then it would stutter leading to blackouts. And that would be fatal. The spice must flow, aeh, I mean steam. :) I'm fine with the first fish loop that alternates between 2 tanks, one filling, one draining.

But that's because I run the main steam pipe through the measurement. That is because I need a change of at least 1 steam to detect steam flowing. A vanilla steam engine uses 30 steam/s at 900KW power. Or one steam every other tick. And the steam engines will run at a fraction of full power when solar power takes over supplying power. So a signal from the steam tanks is actually quite rare. The more steam engines are connected to the tank the more signals it generates, meaning a lower energy consumption can be detected. Here the timer will help because the delay can be set to 60 ticks or 120 ticks easily, again increasing the sensitivity.

My solution is to put as many steam engines as possible behind the measuring apparatus. Clearly that will be limited by the pipe throughput. But you can run a lot of steam engines from a pipe. If needed you can add some pumps. Once that limit is reached though I would say the measuring accuracy is enough and you can build a second, regular, power plant next to it. It will reduce the measuring accuracy again but that's ok. As long as it's not just 1 steam engine for measuring and 200 steam engines in the regular plant.


Especially with nuclear power coming (damn, covarex is expensive and I need 40 light uranium saved for that) I've been thinking of how to extend this method.

As you say with nuclear power steam throughput is different. Most setups run at the limit of pipe throughput under full power. On the other hand the amount of power generated tends to be far greater too. Putting a measuring setup at each line of heat exchangers is not feasable, not enough room. But really just one should suffice.

What I've been thinking is to use pumps instead of power switches. Circuit control the pump for each row of steam turbines. The flow measurement can be separate and depending on the measured steam consumption it activates pumps. If the flow is > 1 steam/tick activate an extra pump, if it's below 1 steam/s deactivate one. And when the pump count reaches 0 then switch over to accumulators. That way the measuring circuit would always have a good steam flow without getting drowned by the GW of potential power by all the other steam turbines.


One thing I noticed is that my setup has a problem with aliens and laser turrets. I don't have enough solar power when aliens attack, especially in the morning, and recently I get so many attacks that it prevented the switch from steam to accumulators. I can see the inserter starting to move to pick up the fish and then another power spike happens and it aborts. Maybe I should use a belt based trigger so the fish makes progress every time there is a low power interval. For now I just have to build more solar panels and kill some alien nests.

Tertius
Filter Inserter
Filter Inserter
Posts: 667
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Power controller for mixing solar with steam/nuclear power

Post by Tertius »

I would not try to manage the power plant by switching on/off the steam supply. Instead, I would simply switch on/off the power output of the whole plant. If the output is disconnected from the main power grid, the plant automatically stops as a whole. This way it doesn't matter what kind of power plant you have.

I didn't yet started Factorio and tried to actually build a setup, but in my planning I tried to isolate the detecting mechanism. I will build one boiler and one steam engine exclusively dedicated for detecting if a power plant is producing power or not. It will consume whatever my trash recycling will sort out, and what usually clogs my storage: wood and coal, and as fallback use real fuel such as solid fuel or even nuclear fuel. I feel that's a nice side effect.

This way the detector can run independently and continuously (it must run continuously) in comparison to the main power plant.

Keep in mind, as soon as 1 unit of steam was detected as being removed from the tank, you can build a setup that waits a few seconds until checking again, so this detector will not actually produce much power.

What happens if the accumulators are empty?
The power plant has to be connected continuously.
What happens if the power demand satisfied by the power plant is so low that it takes a time longer than the detection interval?
The power plant is switched off, and the accumulators are switched on.
The next tick it's detected that the accumulators are empty, and the power plant is switched on and the accumulators off. This moment the counter that determines the detection loop length has to be reset.

If the condition "accumulators are empty" is actually checking for a charge <= 1% and not =0, you have still enough power in the accumulators for providing the factory with power for the 1 tick while the power plant is switched off. To make things stable, you need to charge the accumulators from the power plant until they are at 1% again before you disconnect them. That's an additional challenge, but not energy wasting. You're producing the power required for this 1 tick in advance and store it in the accumulators. That's accommodating for the 1 tick where the power plant is switched off when it is actually supposed to produce power.

On the other hand: is it really necessary to build an actual mini power plant just for detection? Isn't it sufficient to use a detector accumulator instead? I know there have been discussions in the past years about this, but it seems there was never a solution, otherwise you would not come up with your creation.
If you can detect if a laser is firing, you can detect if a factory consumes more power than solar panels can provide. Hm... but there is a difference: you need to connect a detector accumulator to the main power grid as well as the power plant, if the accumulator farm is empty. But this moment the detector accumulator is charged by the power plant and you cannot detect that it would discharge. You need to disconnect the power plant to see a discharge, but the detector accumulator isn't able to provide full power for even 1 tick, only 300 kW. So using whatever kind of steam detector is a viable way and a detector accumulator not.

Or you can forget all of the above and do something extremely simple:
If the accumulator farm charge is < 1%:
connect power plant
else
disconnect power plant

This uses the power plant to bring the accumulator charge to 1%, but any charge above has to be done by other means. This will permanently toggle on/off the power plant as long as there is no solar power, but who cares?

mmmPI
Smart Inserter
Smart Inserter
Posts: 2728
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Power controller for mixing solar with steam/nuclear power

Post by mmmPI »

I'm not sure i understand the difference with a simple setup like adding a pump between boilers and steam engine, active only when accumulator charge is under 10% ?

It would seem that if solar pannel are enough to power the factory, this would cut fuel consumption as the pump would not activate, or it would slowly push steam but would not use it to charge past 10%, only solar being able to do that thus saving fuel ?

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

Re: Power controller for mixing solar with steam/nuclear power

Post by mrvn »

Tertius wrote:
Sun Sep 04, 2022 1:38 pm
I would not try to manage the power plant by switching on/off the steam supply. Instead, I would simply switch on/off the power output of the whole plant. If the output is disconnected from the main power grid, the plant automatically stops as a whole. This way it doesn't matter what kind of power plant you have.
For the plant as a whole that certainly works. But for switching on groups or steam engines or groups of turbines keeping all the electrical networks separated is a pain. Way too many copper wires to place and more importantly remove. Adding a circuit wire to a pump seems easier.

But now I realize that if I do it that way then the turbines will use up the remaining steam. When the pump later gets turned on there would be a massive steam spike filling up all the turbines again and power production would take time to ramp up. So likely whenever a pump gets turned on the flow protector goes crazy and switches everything on.

I've researched nuclear power now and build me some reactors, heat pipes, heat exchangers and turbines. Guess I now have to see how to build the plant to minimize the power poles between turbines connecting too much so I can turn them on in stages with power switches.
Tertius wrote:
Sun Sep 04, 2022 1:38 pm
I didn't yet started Factorio and tried to actually build a setup, but in my planning I tried to isolate the detecting mechanism. I will build one boiler and one steam engine exclusively dedicated for detecting if a power plant is producing power or not. It will consume whatever my trash recycling will sort out, and what usually clogs my storage: wood and coal, and as fallback use real fuel such as solid fuel or even nuclear fuel. I feel that's a nice side effect.

This way the detector can run independently and continuously (it must run continuously) in comparison to the main power plant.
Actually no. If you run the detector all the time then it will charge the accumulators. And then it will switch on the power plant way too soon. You have to switch on the plant and the detector when the accumulators are low and have to switch off the accumulators at the same time.
Tertius wrote:
Sun Sep 04, 2022 1:38 pm
Keep in mind, as soon as 1 unit of steam was detected as being removed from the tank, you can build a setup that waits a few seconds until checking again, so this detector will not actually produce much power.

If the condition "accumulators are empty" is actually checking for a charge <= 1% and not =0, you have still enough power in the accumulators for providing the factory with power for the 1 tick while the power plant is switched off. To make things stable, you need to charge the accumulators from the power plant until they are at 1% again before you disconnect them. That's an additional challenge, but not energy wasting. You're producing the power required for this 1 tick in advance and store it in the accumulators. That's accommodating for the 1 tick where the power plant is switched off when it is actually supposed to produce power.

On the other hand: is it really necessary to build an actual mini power plant just for detection? Isn't it sufficient to use a detector accumulator instead? I know there have been discussions in the past years about this, but it seems there was never a solution, otherwise you would not come up with your creation.
Yes it is. Otherwise the accumulators are basically wasted. You will charge them from the power plant if you don't have a steam flow detector.
Tertius wrote:
Sun Sep 04, 2022 1:38 pm
If you can detect if a laser is firing, you can detect if a factory consumes more power than solar panels can provide. Hm... but there is a difference: you need to connect a detector accumulator to the main power grid as well as the power plant, if the accumulator farm is empty. But this moment the detector accumulator is charged by the power plant and you cannot detect that it would discharge. You need to disconnect the power plant to see a discharge, but the detector accumulator isn't able to provide full power for even 1 tick, only 300 kW. So using whatever kind of steam detector is a viable way and a detector accumulator not.

Or you can forget all of the above and do something extremely simple:
If the accumulator farm charge is < 1%:
connect power plant
else
disconnect power plant

This uses the power plant to bring the accumulator charge to 1%, but any charge above has to be done by other means. This will permanently toggle on/off the power plant as long as there is no solar power, but who cares?
Again that was used in the past. What will happen is that you reach 1% and then power switches every tick. While this works and is very economical have you tried using the power graph with that? It flickers like crazy and is full of spikes making it mostly unusable.

Plus where is the challenge in that? :)

mmmPI
Smart Inserter
Smart Inserter
Posts: 2728
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Power controller for mixing solar with steam/nuclear power

Post by mmmPI »

You don't get the same flickering if you wire the pump between boilers and steam engine because there is still some steam in the pipes when the accumulators are charged above the threshold if it occurs due to steam charging.

For nuclear, you need to add the pump between the steam tank buffer, and the turbines and have enough steam tank to buffer one nuclear cell.

The better part of using a pump to gate the steam is that you can over the course of the game increase the threshold to 95% or so similar when using the power switch to gate the whole plant, because unless you stop building your energy consumption will increase eventually to the point where the insuficient number of accumulator doesn't have enough throughput for the whole factory.

Unless you purposefully maintain a number of accumulator insuficient for lasting the whole night, yet numerous enough to have enough troughput for the whole factory during the first half of the night, but that could be a challenge :)

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

Re: Power controller for mixing solar with steam/nuclear power

Post by mrvn »

I manage to build a 2x4 nuclear plant on the half island I've got with a near perfect fit.

The design is a bit different from the usual since I'm limited to a square to build on. Also turbines are wired into horizontal rows, 28 turbines across 14 heat exchangers make up a set that is a separate electrical system each. I also have 3 times as many turbines as heat exchangers would call for because this is supposed to run in parallel to solar pannels. Steam can be produced 24/7 but turbines run only 1/3rd of the time (less with accumulators, more if I lack solar panels). All the control logic for the reactor runs on solar power and all the power poles are out of reach so I didn't had to remove any copper wires. Overall this gives 1GW sustained power, 3GW if run only at night.

Next step will be to add the steam flow measurement and power switches and control logic to switch on turbines.

I also have some free space left on the tile. That's currently used for covarex but I want to create nuclear fuel for the trains there as well. Would be nice to have the whole uranium / nuclear processing on a single tile.
nuclear-1.png
nuclear-1.png (3.94 MiB) Viewed 4782 times
nuclear-2.png
nuclear-2.png (3.73 MiB) Viewed 4782 times

gGeorg
Filter Inserter
Filter Inserter
Posts: 392
Joined: Wed Jun 19, 2019 8:06 pm
Contact:

Re: Power controller for mixing solar with steam/nuclear power

Post by gGeorg »

mrvn wrote:
Sat Sep 03, 2022 11:48 pm
You are wasting fuel.

Accumulators just store energy. As you say nothing is wasted there. But it matters where that energy comes from. With steam engine producing power costs fuel.
So the power you want to store in accumulators is solar power. Otherwise you would waste free power and pay for it with fuel.
Partially correct, in fact there is no waste of fuel ever possible.
Solar made power has priority for consumption. Result is, solar power is burned first, then in case of excess is stored.
Which also means, power from solar panel has priority for "consumption" in battery. Also known as charging.
Which means in case of full battery, steam engine auto-throttle self down while solar made power is burned all.
Which means, if you control solid power-plants (coal,nuclear) to by a simple SR switch to limit charging at 10-20% of battery. You waste no fuel, and your battery usage is very good. (e.i. not perfect)
It means, you might talk about small wastage in battery capacity.
You can see practical usage here, in my Perfect clover-leaf
viewtopic.php?f=208&t=96233
see section
2. Connecting power plant to grid and Wasteless
Image
as you see, orange line goes up and down fallowing sun, and is consumed all.
Contrary nuclear plant is turned on, only when battery goes too low. Thanks to smart design of Nuclear plant, it cam be switched on/of anytime, and No waste of fuel, even a bit.
It costs only 3 combinators and one switch.

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

Re: Power controller for mixing solar with steam/nuclear power

Post by mrvn »

The problem is that in the morning you don't have enough power so steam/nuclear power is used to charge the accumulators. Then at noon you have an excess of solar power and nowhere to store it.

The idea is to save fuel by storing excess solar power, when available, for use later. So any storage of power produces with fuel wastes that fuel by reasoning that you later can't store excess solar power because the accumulators will be full.

In your setup you turn on nuclear at 40% charge and that will charge the accumulators by using nuclear power. And you turn nuclear of at 80% charge. That means 40% accumulator storage is bought by fuel. 40% came from somewhere and is never touched (except in an emergency). And only 20% is actually storing solar power (worst case).

In your graph notice how all the charging cycles of the accumulators coincide with nuclear power being on? You don't have enough solar panels for anything to spare so they never charge the accumulators. In that ratio and that factory you totally wasted all the resources to build accumulators (except a few for spikes). They never save fuel.

gGeorg
Filter Inserter
Filter Inserter
Posts: 392
Joined: Wed Jun 19, 2019 8:06 pm
Contact:

Re: Power controller for mixing solar with steam/nuclear power

Post by gGeorg »

mrvn wrote:
Sun Sep 11, 2022 11:47 am
In your setup you turn on nuclear at 40% charge and that will charge the accumulators by using nuclear power. And you turn nuclear of at 80% charge. That means 40% accumulator storage is bought by fuel. 40% came from somewhere and is never touched (except in an emergency). And only 20% is actually storing solar power (worst case).
Yes, 40% of accumulator capacity is emergency buffer. Lasers are real. It is in the public blueprint for safety reasons. In my usage I use 20-50% range. It means, up to 30% off accu capacity is used (wasted) in worst case for storing nuclear power.
mrvn wrote:
Sun Sep 11, 2022 11:47 am
In your graph notice how all the charging cycles of the accumulators coincide with nuclear power being on? You don't have enough solar panels for anything to spare so they never charge the accumulators. In that ratio and that factory you totally wasted all the resources to build accumulators (except a few for spikes). They never save fuel.
That is only one sided point of view. Look at your graph:
Image
You see the red area ? That is the wasted solar energy. You might also say :
In that ratio and that factory you totally wasted all the resources to build accumulators Solar panels (except a few for spikes). They never save fuel.

You probably need to refactor your project of "Save resources by accu charging optimization" by researching what capacity is cheaper to build : solar, accu, or steam ?

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

Re: Power controller for mixing solar with steam/nuclear power

Post by mrvn »

gGeorg wrote:
Sun Sep 11, 2022 3:28 pm
You see the red area ? That is the wasted solar energy.
Indeed it is. The red area is a sign that you should build more accumulators or that you build too many solar panels. If you add more accumulators to take advantage of that red area then green line (steam power) should go to 0. They aren't in the perfect ratio since I deleted part of the accumulator field so they would run out at night and steam power has to take over for the test setup. This would happen in a normal game too if you blueprint them in different ratios or your production of solar panels is faster than accumulators and they lack behind or something.

The important difference between the two graphs is the left side. The accumulators charge nearly exclusively from solar. That's ~98% of the charge coming from solar.


The rules for what power to expand next are this:
  1. Brownouts or the low steam siren going of? You ignored power too long and your backup power is insufficient. More boilers or heat exchangers is probably the fastest way to recover.
  2. Green line isn't zero and red area exists? More accumulators make better use of existing solar panels.
  3. Only green line isn't zero? More solar panels would help.
Overall you want a small red area to exist but the green line remain 0. Then you produce and store just a bit more solar power than your base needs.

gGeorg
Filter Inserter
Filter Inserter
Posts: 392
Joined: Wed Jun 19, 2019 8:06 pm
Contact:

Re: Power controller for mixing solar with steam/nuclear power

Post by gGeorg »

I think you over-focus the idea "steam power stored in battery means waste" .
I dont agree on this.
Lets assume:
4 leaf Nuclear has 480MW max output. (or some coal based plant of same output)
Then you add 480/0.3 = 1600 accumulators which can max output 480MW
It means, when Nuclear is switched off, accu field could provide the same power output. Preventing brownout.

Then add variable amount of Solar panels for fuel save.
Thanks to holy ratio 0.84 (21:25) we know that 1905 solar panels is max amount which can be backed by 1600 accu, which are backin one clover leaf.

Lets assume consumption of about 900-1000MW
Important is, that in my setup can sustain power output of 960MW but peak at 1440MW. (Solar+Accu+Steam full output)
In your case, when you made effort to not store steam based power in accu, peak of system is equal to sustain = 960MW.
If you ask me, I prefer flexibility over few possibly wasted accu capacity.

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

Re: Power controller for mixing solar with steam/nuclear power

Post by mrvn »

gGeorg wrote:
Sun Sep 11, 2022 9:34 pm
I think you over-focus the idea "steam power stored in battery means waste" .
I dont agree on this.
Lets assume:
4 leaf Nuclear has 480MW max output. (or some coal based plant of same output)
Then you add 480/0.3 = 1600 accumulators which can max output 480MW
It means, when Nuclear is switched off, accu field could provide the same power output. Preventing brownout.

Then add variable amount of Solar panels for fuel save.
Thanks to holy ratio 0.84 (21:25) we know that 1905 solar panels is max amount which can be backed by 1600 accu, which are backin one clover leaf.

Lets assume consumption of about 900-1000MW
Important is, that in my setup can sustain power output of 960MW but peak at 1440MW. (Solar+Accu+Steam full output)
In your case, when you made effort to not store steam based power in accu, peak of system is equal to sustain = 960MW.
If you ask me, I prefer flexibility over few possibly wasted accu capacity.
1905 solar panels will recharge 1600 accu over the day with a constant energy draw of whatever that number turns out to be. But every W you charge the accumulators with from nuclear is 1W of solar energy you won't have space for later in the day. So you pay fuel for something would have gotten for free a bit later. I call that waste.

Ok, lets assume consumption of about 900-1000MW. From memory solar power then is 1905*60/0.7 = ~163MW. The rest is all nuclear. In that situation you are never wasting any solar energy because your energy draw is always above the solar power. There is never anything left to charge accumulators with, as can be seen in your graph. There is no "red" area like in my graph. So there is no loss.

On the other hand the accumulators are there purely to smooth out spikes. They get used when you draw more than solar + nuclear power and get recharged by nuclear power. You could also replace each 19 accumulators with steam tankage and an extra turbine. Not sure how you value the cost of turbines vs. accumulators. I think a turbine costs more resources but is easier to build than 19 accumulators and is smaller (although accumulators can fit in in so many places around the base that are left free if you care about space that much).

I did the same as you in many past games. I started adding solar power until I reached the nuclear age. At which point there is so much power that I just stopped building boring solar panels. So as the base expands it runs more and more on nuclear then. My controller idea only makes sense when you use more solar power than steam/nuclear. When they are just backups really. Not an integral part of the every second power supply. If you stop expanding your solar fields when you have nuclear then it makes no sense.

Tertius
Filter Inserter
Filter Inserter
Posts: 667
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Power controller for mixing solar with steam/nuclear power

Post by Tertius »

mrvn wrote:
Fri Sep 02, 2022 5:02 pm
What do you think? Is there a simpler way?
Finally, I worked out my own contraption of a smart solar power/power plant switch.
Essentially, it organizes 3 power grids:
  • Main power grid with solar panel field and consumers
  • Accumulator field
  • Power plant (steam or nuclear)
Principal rules of operation:
  1. Goal is to always satisfy the energy demand of the consumers.
  2. There are enough solar panels to satisfy the energy demand of the consumers during full sunlight (otherwise accumulators are pointless, because they never charge)
  3. Either the power plant or the accumulators are connected to the main power grid, but never both, and never none.
  4. If the accumulators have more than 3% charge, connect the accumulators to the main power grid (and disconnect the power plant)
  5. A circuit is testing every 200 ticks whether there is energy demand from the power plant or surplus from the solar panels. During the test, which will take 1-10 ticks, the power plant is temporarily connected and the accumulators are temporarily disconnected.
  6. The test is only performed, if accumulator charge is 3% or below.
overview.png
overview.png (2.35 MiB) Viewed 4516 times

Zoomed part of the circuit:

annotated.png
annotated.png (699.49 KiB) Viewed 4516 times

Complete lab blueprint with solar, accumulators, power plant and consumers:

Only the actual circuit in the center:

Explanation:

(You can of course ignore/remove the nixie tubes. I used them for development and debugging. They serve no practical purpose)

The idea is to connect a single dedicated steam engine to the main power grid for a few ticks. A circuit checks, whether the steam level in the storage tank that supplies the steam engine with steam has lowered. If it has lowered, the power plant needs to be connected, otherwise the accumulators can be connected.
The circuit "waits" for up to 10 ticks for the level to lower. If it lowered, the pump that feeds the steam engine is immediately turned off, so the test time is usually shorter than 10 ticks.

This test is done every 200 ticks, which is counted by the timer that is made from combinator 3.
The check is done by simultaneously do this:
  1. connect the steam engine to the main power grid
  2. if the accumulators are connected to the main power grid, disconnect the accumulators and connect the power plant
  3. activate pump P2
See this table:

table.png
table.png (14.14 KiB) Viewed 4516 times

Tricky is the on/off setting for the power switches and the pump P2. To do these things simultaneously, we need to check multiple conditions on P2 and on all the power switches S1, S2 and S3, all at the same time.

D is the test timer, C is discussed later.
For simultaneous checking of multiple conditions, the EVERYTHING and the ANYTHING signals are used on P2, S1, S2, S3. To do this, we normalize the values by add/subtracting a constant value to/from each of the values, so we can check for the same condition for every signal. For example, to A>200 AND B>300, we add A=-200 and B=-300 and check for EVERYTHING>0.

Unfortunately, one condition is >= and the other is <, so this will not work. But if we duplicate timer D with a timer that runs reverse, i. e. from 0..-200 instead of 0..+200, this will work. I called this E and used combinator 4 for this. The normalizing values come from the constant combinator between S2 and S3, and the power switches can test on >0 or <0.
Because all switches are on the same wire and check the same signals, they all switch simultaneously.
For pump P2 it's the same, but it's using the counter D, which is the exact inverse of E.

You might ask why D and E are not running on the same combinator: that's not possible, because due to the conditions, a negative value must not appear at P2. It's also not possible to filter one value with a combinator, because that will introduce a latency of 1 tick, which must not be: the pump and the switches must operate at exactly the same tick.

Ok, now there is that 3rd counter with value C. It's running on combinator 2. It counts the ticks since the last steam consumption. It's the main counter here: if the last steam consumption took place more than 200 ticks ago, we assume the solar panels are producing so much power the power plant isn't needed.
Counter C is reset to 0, if the steam level lowered. This condition is computed by combinator 1. It multiplies the steam level with -1 and adds the result to the original level. Since the negated value has a latency of 1 tick, the sum of both is -1, if the level lowered, so this is our criteria for resetting combinator 2.

Then we have another part: Combinator 6 checks accumulator charge. As long as it is above 2 (percent), it feeds some artificial values into the wires, so the power switches become locked at status "connect accumulators, disconnect power plant, disconnect sensor".
And at the same time, a -1 is injected through combinator 7 to our main counter C, so it halts as well.
This is to make everything halt, if there is enough accumulator charge. The tests are not performed while there is still enough charge.

The last part is combinator 5. Similar to counter C, it also checks if the steam level lowered. If it lowered, it adds a reset value to counters D and E (combinators 3 and 4). This makes the test end prematurely, so if it already detected the steam level lowered, it doesn't run the full 10 ticks.

P1 is just refilling the storage tank if the level gets below 100. Nothing special.
Fuel supply is negligible. One piece of coal lasts for hours.


This is the power chart. It shows perfect switches and the main power grid is never disconnected from power supply for even 1 tick.
power graph.png
power graph.png (100.6 KiB) Viewed 4516 times

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

Re: Power controller for mixing solar with steam/nuclear power

Post by mrvn »

Tertius wrote:
Thu Sep 15, 2022 12:00 am
During the test, which will take 1-10 ticks, the power plant is temporarily connected and the accumulators are temporarily disconnected.
That is already required by rules 4 and 6. Nothing temporary there. Accumulators are just plain off.

gGeorg
Filter Inserter
Filter Inserter
Posts: 392
Joined: Wed Jun 19, 2019 8:06 pm
Contact:

Re: Power controller for mixing solar with steam/nuclear power

Post by gGeorg »

Tertius wrote:
Thu Sep 15, 2022 12:00 am
[*]A circuit is testing every 200 ticks whether there is energy demand from the power plant or surplus from the solar panels. During the test, which will take 1-10 ticks, the power plant is temporarily connected and the accumulators are temporarily disconnected.
[*]The test is only performed, if accumulator charge is 3% or below.
[/list]

Explanation:
The idea is to connect a single dedicated steam engine to the main power grid for a few ticks. A circuit checks, whether the steam level in the storage tank that supplies the steam engine with steam has lowered. If it has lowered, the power plant needs to be connected, otherwise the accumulators can be connected.
The circuit "waits" for up to 10 ticks for the level to lower. If it lowered, the pump that feeds the steam engine is immediately turned off, so the test time is usually shorter than 10 ticks.
It means, the factory is powered by single steam engine in the time of test. It creates brownout each 200ticks whenever accu charge is below 3% for 1-10 ticks
1. Factory performance goes down
2. All combinators which process pulse signal miscalculates (some popular examples Kovarex, Nuclear cell feeding, smart train stations)

Evaluation:
Design refused :ugeek:
Last edited by gGeorg on Thu Sep 15, 2022 12:40 pm, edited 1 time in total.

Tertius
Filter Inserter
Filter Inserter
Posts: 667
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Power controller for mixing solar with steam/nuclear power

Post by Tertius »

gGeorg wrote:
Thu Sep 15, 2022 11:56 am
It means, the factory is powered by single steam engine in the time of test.
This is not the case. If you read more than just the core principles, you see that during the time of the test the power plant is always connected. And before you ask, no, the accumulators are not connected during the test. That's what all the fuss with the switch criteria is about.

And if you ask if that tiny single steam engine is able to detect any power demand in view of a huge full blown power plant in the background: yes, it is. I tried this, and it actually worked out. To prove this, I used rather large solar fields, consumers and power plants for a lab: about 100 MW, not tiny demo installations with only a few MW.
It's interesting to see how the steam is consumed in tiniest amounts of 1-2 already in the first tick, but that's enough.

Post Reply

Return to “Energy Production”