Thrashing / timing issues with passback Kovarex
-
- Inserter
- Posts: 20
- Joined: Thu Oct 31, 2024 4:43 am
- Contact:
Thrashing / timing issues with passback Kovarex
For debugging purposes, I've added combinators and lamps that display red for 1 second when a centrifuge stops working.
In previous iterations of this design, I found that a fixed hand size of 10 (so 5 swings per craft to move 40 U-235 and 2 U-238) was a little too slow and would cause the centrifuges to pause for ingredients every 8 crafts or so. So I added a decider combinator per inserter (not happy about that) to control the hand size dynamically to bring them down to 4 swings per craft.
The inserters are clearly fast enough now, but I have to manually play with the timing offset of the left vs. right centrifuge's crafting or there will be regular pausing every N crafts. N can have a lot of variation. I've attached a savegame with 4 copies of the same design. One doesn't pause at all, while others have pausing every 16, 8, or 3 crafts.
In the past I've found that timing issues like this are either self-correcting with enough cycles, or have an identifiable flaw in the throughput of some element, but that doesn't seem to be the case here. There is no throughput issue, yet timing issues don't self-correct.
I want to make this manual tuning unnecessary, but how?
Savegame:
Re: Thrashing / timing issues with passback Kovarex
Hm, how exactly do you want to cut down the number of inserer passes to 4 for 40 U-235 and the U-238? You'll always need at least 4 for the U-235 as the maximum inserter capacity is 12.
In general the odd breaks might be caused by exactly this stack size. At least it would explain a pause every 3 production cycles.
After four inserer movements you should have moved 48 U-235, so you have 8 U-235 extra. To get the next 40, you only need three additional swings, and you'll still have a surplus of 4 after that. For the next cylce you will again only need three swings, eating away the last 4 surplus U-235. After that you'll need again 4 swings to get at least 40 which might cause a break.
Other factors might be harder to determine. Perhaps the order and timing how you prefilled your machines might have an impact? Or at what time some inserters start to move might lead to a different periodicity? It's an extremely fast setup eating a lot of input, so even small impacts might be felt.
In general the odd breaks might be caused by exactly this stack size. At least it would explain a pause every 3 production cycles.
After four inserer movements you should have moved 48 U-235, so you have 8 U-235 extra. To get the next 40, you only need three additional swings, and you'll still have a surplus of 4 after that. For the next cylce you will again only need three swings, eating away the last 4 surplus U-235. After that you'll need again 4 swings to get at least 40 which might cause a break.
Other factors might be harder to determine. Perhaps the order and timing how you prefilled your machines might have an impact? Or at what time some inserters start to move might lead to a different periodicity? It's an extremely fast setup eating a lot of input, so even small impacts might be felt.
-
- Inserter
- Posts: 20
- Joined: Thu Oct 31, 2024 4:43 am
- Contact:
Re: Thrashing / timing issues with passback Kovarex
Download the save file and take a look. They already move exactly 40 U-235 and 2 U-238, so what you're theorizing is not how it's designed and is not the problem I am trying to find a solution for.
Re: Thrashing / timing issues with passback Kovarex
Sorry, I got confused by your description. So you keep the limit at 10 U-235 all the time?
As I can't load the savegame without switching to the experimental build, I can't check directly, but something else might be the issue. The machines at the beginning of your setup work without breaks, these happen later and become more frequent further down, right? In that case it might be caused by the inserter picking up U-238 from the belt. Further down these one might need to wait as it will run into gaps of U-238 already taken off from the belt, leading to an interruption. You might want to check that.
As I can't load the savegame without switching to the experimental build, I can't check directly, but something else might be the issue. The machines at the beginning of your setup work without breaks, these happen later and become more frequent further down, right? In that case it might be caused by the inserter picking up U-238 from the belt. Further down these one might need to wait as it will run into gaps of U-238 already taken off from the belt, leading to an interruption. You might want to check that.
-
- Fast Inserter
- Posts: 136
- Joined: Thu Oct 17, 2024 10:56 pm
- Contact:
Re: Thrashing / timing issues with passback Kovarex
Played with this idea, not on the save but in the map editor.
Try replacing the input u238 inserter with a bulk inserter. When I saw inconsistency on the passback it was because the stack inserter was trying to grab 16 u238; which brought havoc to the design.
For dynamic stacking I used a trick inpired by reddit: ( everything < 1 ) ? { s=16 } : 0. If everything is less than one set S to 16. Tie that to read hand contents, the second the stacker grabs inventory it reads. This sets the hand stack size to 0, causing the stacker to drop its contents. Stackers are quick enough to grab 16 items. This trick is done at the passback. Normal stacking done on the U235.
Edit: important one too! The u238 has to have a stack limit set on it so it doesn't overload the centrifuges.
Try replacing the input u238 inserter with a bulk inserter. When I saw inconsistency on the passback it was because the stack inserter was trying to grab 16 u238; which brought havoc to the design.
For dynamic stacking I used a trick inpired by reddit: ( everything < 1 ) ? { s=16 } : 0. If everything is less than one set S to 16. Tie that to read hand contents, the second the stacker grabs inventory it reads. This sets the hand stack size to 0, causing the stacker to drop its contents. Stackers are quick enough to grab 16 items. This trick is done at the passback. Normal stacking done on the U235.
Edit: important one too! The u238 has to have a stack limit set on it so it doesn't overload the centrifuges.
-
- Fast Inserter
- Posts: 136
- Joined: Thu Oct 17, 2024 10:56 pm
- Contact:
Re: Thrashing / timing issues with passback Kovarex
I did the above at the end of my day. So I was rushing to bed. Once I slept, I thought about this some more and had an idea to check when I woke up.
Messed with stack sizes on u238 input, and came to the conclusion that the important thing is to have it set to 5. The particular arm doesn't matter (so you could use anything that is fast enough from an energy use perspective).
But I noticed ingredients where indicating short feed at 64x. My mechanism was set to not include in craft ingredients, when I did it I came to the conclusion that the passback was being stolen from by output. Actually, it's a bit more complicated then that, input gets shorted as well because items are stored in an internal buffer and if you don't account for that the process runs poorly (5/6 speed of the screen shot). Even if you drop include in craft ingredients it will still slightly short feed.
Settings for i/o arms with "include in craft" checked on work station set to: enable on 147 u235 (output), enable on 10 u238 (input) eliminated noticeable pauses and the machines run at 153 u235/minute (theoretical efficiency is something like 156).
Picture when I'm home from work.
Messed with stack sizes on u238 input, and came to the conclusion that the important thing is to have it set to 5. The particular arm doesn't matter (so you could use anything that is fast enough from an energy use perspective).
But I noticed ingredients where indicating short feed at 64x. My mechanism was set to not include in craft ingredients, when I did it I came to the conclusion that the passback was being stolen from by output. Actually, it's a bit more complicated then that, input gets shorted as well because items are stored in an internal buffer and if you don't account for that the process runs poorly (5/6 speed of the screen shot). Even if you drop include in craft ingredients it will still slightly short feed.
Settings for i/o arms with "include in craft" checked on work station set to: enable on 147 u235 (output), enable on 10 u238 (input) eliminated noticeable pauses and the machines run at 153 u235/minute (theoretical efficiency is something like 156).
Picture when I'm home from work.
-
- Fast Inserter
- Posts: 136
- Joined: Thu Oct 17, 2024 10:56 pm
- Contact:
Re: Thrashing / timing issues with passback Kovarex
Alright, final one. Tested this out some, there's a valid range of inputs where you should see 153/154 ipm on a 10 minute production graph. For "theoretical" I was going on the game's estimate of 1.3 ips * 60 * 2. Actual calculated value is 1.27875ips. Yay rounding
. When all other things are factored in then it's 153.45 ipm using only two centrifuges.
But basically: yeah, there was a way I could see thrashing and yeah, it is fixable. You have to set both the hand stack size and limit the stack size of the inserters handling i/o; but not passing material back and forward.
The picture is mainly to certify without running the blueprint, that the thing runs for 10 hours and at close to a calculated max rate.
Settings you want on the inserters feeding items in and out of the centrifuges:
include in crafting is checked by default
input u238 can work if set to 12, filter u238, stack size limited to 5 items.
Output arm is set to activate when u235 > 135 items. Set arm stack size to 4 so stacker could make complete stacks.
without include in crafting checked
input u238 to be a value of 7-8 with a stack size of 5 on a bulk inserter. A larger stack size might reduce values - didn't test it.
Output you want better than 95 items before the output arm activates. I tried various schemes but set the stack size of the arms to about 4.
Your use case may vary, but this ought to be a good starting point for modification. Good luck.

But basically: yeah, there was a way I could see thrashing and yeah, it is fixable. You have to set both the hand stack size and limit the stack size of the inserters handling i/o; but not passing material back and forward.
The picture is mainly to certify without running the blueprint, that the thing runs for 10 hours and at close to a calculated max rate.
Settings you want on the inserters feeding items in and out of the centrifuges:
include in crafting is checked by default
input u238 can work if set to 12, filter u238, stack size limited to 5 items.
Output arm is set to activate when u235 > 135 items. Set arm stack size to 4 so stacker could make complete stacks.
without include in crafting checked
input u238 to be a value of 7-8 with a stack size of 5 on a bulk inserter. A larger stack size might reduce values - didn't test it.
Output you want better than 95 items before the output arm activates. I tried various schemes but set the stack size of the arms to about 4.
Your use case may vary, but this ought to be a good starting point for modification. Good luck.