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.
Tertius
Filter Inserter
Filter Inserter
Posts: 933
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

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

Post by Tertius »

I thought about mrvn's remark and I realized that the setup can be optimized. In my first version, the development history is still present, where I first added the test circuit and only later the accumulators.

Counter D is not required, because pump P2 runs on the same condition as S1, which doesn't need access to counter C but only E.
This means 2 combinators less - the one for D and another, because less constrains with wires.

I also doubled the ticks for timer C to declare status "solar panels produce enough power".

After that, still a tiny probability is left that the accumulators are slowly sucked empty, if the energy demand is only very slightly above the solar panel production for a longer time. Extremely unlikely power demand is painstakenly following the times of day and at the same time always staying slightly above solar panel production, so the circuit cannot detect the slow unloading, but to even cover this case, I added an emergency power switch that will directly load the accumulators by the power plant to 1% if they are at 0%. I wasn't able to produce the situation that leads to the accumulators sucking empty, and never saw it even close during tests, but just be sure. We all know that everything that's possible, no matter how small the probability, will eventually happen.
(by the way, this switch is that simple solution that "makes the energy graph ugly". Could replace the whole setup without loss of functionality, only at the cost of an ugly graph)
Screenshot 2022-09-16 010950.png
Screenshot 2022-09-16 010950.png (635.53 KiB) Viewed 1452 times

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

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

Post by mrvn »

Better charge the accumulators to 2% or 5% if they are below that level (best to make that configurable with a constant provider) to give a bigger margin to handle spikes or alien waves. With lots of lasers firing the backup power might be insufficient over short times.
foamy
Filter Inserter
Filter Inserter
Posts: 432
Joined: Mon Aug 26, 2019 4:14 am
Contact:

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

Post by foamy »

Tertius wrote: Thu Sep 15, 2022 12:39 pm
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.
That's kind of interesting, since a steam engine can only draw 30/s, which means even at full draw you should only be seeing a drop every other tick. However, because fluids use floats, you might be seeing some kind of flooring? Going from, say, 25000 to 24999.9 returns you a result of 24999?
Tertius
Filter Inserter
Filter Inserter
Posts: 933
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

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

Post by Tertius »

Our interface into the game is the circuit network, and the circuit network runs strictly with 32-bit integer numbers only. If fluids are computed with floats, the circuit network only sees their (floored) integer values. We only see 0, 1, 2, .., 24999, 25000. We don't know if a value is really 0, 1, 2, ... or actually 0.5, 1.1, 1.5, 0.5, 24999.9.

However, I don't need floats with the above circuit. It checks steam level differences from single ticks to the next tick, and even differences of 1, 2, -1, -2 are detected as "enough solar power" or "system is running with accumulators", and the next check after a detected increase or decrease is taking place 200 ticks later.

30/s steam limit is 30 per 1 second or is 1 per 2 ticks. And 1 per 200 ticks is enough for detecting level changes, so the limit doesn't apply.

So the single steam engine used as detector isn't even running on any significant power. It's running on 1/200 = 0.5% of its share of all of the map-wide power suppliers. It's connected for 1-2 ticks, then 200 (or more) ticks disconnected. A piece of wood lasts as long as 2 stacks of it under full power. And it's only used/burnt while accumulator load is below 3%, so even if you fill the fuel inventory manually with a stack of wood, it will probably last for the rest of the game map lifetime.
Post Reply

Return to “Energy Production”