[13.9][Twinsen] Inserter "Hold Mode" Sends Signal One Tick Too Long
Posted: Wed Jul 20, 2016 2:08 pm
When using inserters to read their hand in "hold mode", I get that items are sometimes counted twice in my circuit network in situations when I do not expect them to be. In particular, consider the following setup:
However, this is not what happens on either circuit: When the inserter grabs something from the top chest, those items are sent to the circuit network both by the chest and by the inserter, and thus counted twice, causing an increase in the signal for one tick. Similarly, when it places something in the lower chest, those items are sent by both chest and inserter. I created a circuit which tests this as follows: The left setup tests the top circuit. Turning the constant combinator off activates the inserter, and then the circuit network is passed through the top *-1 combinator, and the difference of the current signal to the signal one tick ago is tested to see if it is positive, and if so, it is counted by the +0 combinator below. If the signal were non-increasing, the light would not come on. A similar setup on the right tests the lower circuit. The result is that both lights will come on if the inserters are activated.
I've noticed that, if the inserter on the left setup is set to "pulse mode", one gets no double counting - so "pulse mode" appears to be activating one tick after "hold mode" currently does. I also tested this using belts (also in "hold mode") in place of the top chest, the same issue occurs, but if one replaces the lower chest by a belt, I get the expected behavior.
Here is a link to a save file featuring the pictured setup
Were the inserter activated, I would expect that the upper red network's signal is non-increasing, giving me the items which are either held in the upper chest or held by the inserter. Similarly, I would expect that the lower green network's signal is non-decreasing, giving me the items either held by the inserter or held in the lower chest.However, this is not what happens on either circuit: When the inserter grabs something from the top chest, those items are sent to the circuit network both by the chest and by the inserter, and thus counted twice, causing an increase in the signal for one tick. Similarly, when it places something in the lower chest, those items are sent by both chest and inserter. I created a circuit which tests this as follows: The left setup tests the top circuit. Turning the constant combinator off activates the inserter, and then the circuit network is passed through the top *-1 combinator, and the difference of the current signal to the signal one tick ago is tested to see if it is positive, and if so, it is counted by the +0 combinator below. If the signal were non-increasing, the light would not come on. A similar setup on the right tests the lower circuit. The result is that both lights will come on if the inserters are activated.
I've noticed that, if the inserter on the left setup is set to "pulse mode", one gets no double counting - so "pulse mode" appears to be activating one tick after "hold mode" currently does. I also tested this using belts (also in "hold mode") in place of the top chest, the same issue occurs, but if one replaces the lower chest by a belt, I get the expected behavior.
Here is a link to a save file featuring the pictured setup