5 ms·
If you build a controller for a single nuclear reactor, a bang-bang controller is indeed pretty simple once you know how to build an SR latch. Scaling that to
by eric-hu 6y ago
If you build a controller for a single nuclear reactor, a bang-bang controller is indeed pretty simple once you know how to build an SR latch.
Scaling that to multiple reactors becomes complex because you can no longer control reactors independently and still get adjacency bonuses from them operating together. Further, there are complexities from emergent behavior that you have to control for. Steam turbines, like steam engines, auto scale steam consumption to power demand. The problem is they don’t do it uniformly. If you have 2 turbines attached to 2 tanks and you only need 1, the game might consume all of 1 tank first, leaving you with the 50% burst capacity. It becomes a big problem with day/night cycles and solar/accumulators in the grid.
I never tried to balance this, but I suppose it’s possible by building a circuit to link together all tanks and shut off their flow when one‘s storage deviates too much from the average. This sounds really complex to me and not worth it.
I’ve explained to the best of my understanding of the game engine’s behavior, but I know that fluid mechanics is also inaccurate and complex to design for. There’s a known issue with flow behaving asymmetrically. One reason is because the game updates state in a certain order, so water and steam flow with a bias for certain directions (n, s, e, w).
Also, thanks for teaching me a term from control theory (1)
(1) https://en.m.wikipedia.org/wiki/Bang–bang_control https://en.m.wikipedia.org/wiki/Bang–bang_control
- willis936 6y agoAh individual control of a large array of reactors is trickier. I think the bang-bang controller with keeping all reactors synchronized has good legs, but it stops scaling well at some point. If the buffers become the limitation and you don’t want to run all of the reactors synchronized then a PID controller would be a good pick. The output value would choose how far up the row of reactors you enable. If you could force max load on will, then loop tuning is a possibility. To maintain the simultaneous reactor bonus, you would want to keep the fueling cycle synchronized and just adjust which reactors are enabled each cycle. This can be done with a clock that has a period of one fuel cycle. One interesting thing is that due to the nature of reactors, you will have higher efficiency in running more reactors if your buffer does not run out. It might be possible to eek out a little more efficiency if you fall back to a bang-bang controller in low load scenarios (making sure the threshold and number of reactors used won’t overfill the buffer, which is practically unlikely in low load scenarios). I would have to experiment with this a bit more to see if it’s reasonable to capture more efficiency. All of this is practically orthogonal to the standard players perception of efficiency, but I find it fun. https://en.wikipedia.org/wiki/PID_controller https://en.wikipedia.org/wiki/PID_controller https://github.com/quchen/articles/blob/factorio/factorio/circuitry.md#pid-controller https://github.com/quchen/articles/blob/factorio/factorio/ci...
- eric-hu 6y agoFascinating write up! Thank you for sharing!