Precise Controll Over Inserter Output to Reduce Belt Buffer

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Dak31
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jun 25, 2018 11:17 pm
Contact:

Precise Controll Over Inserter Output to Reduce Belt Buffer

Post by Dak31 »

Hello. I recently came across a unique problem in factorio, and upon finding a nice solution I thought it would be beneficial to the community as I found little help when searching online.

This post will hopefully explain how to make an inserter of your choice inserting onto a belt only operate while resources are needed at the final destination, while leaving no buffer of materials on said belt. I'm not sure just how useful such a function will be for general factorio game play, but just in case some other poor soul who needs this, I will share my design.

So the problem I had was such: How do you move materials from one logistic network (LN) to another? Not a hard problem at all, simply use belts or a train. With the distance making use of a train impractical, I needed to simply use a requester chest in LN "A" and insert it on a belt going to LN "B". But since I was moving nuclear fuel (NF), I thought it would be wasteful to have a large buffer of this mildly precious resource sitting on the belt. So, this constraint, no materials sitting on the belt, made moving materials from one LN to another actually quite difficult, at least at first. The first place I stared was: How do we make the inserter "sleep" in between swings (since carrying a on/off signal from the LN B should be easy enough)?

Constant Combinator -> CC
Decider Combinator -> DC
Arithmetic Combinator -> AC

TIMER

Like I said, I had some trouble finding existing information online, but what I did manage to find was an ingenious (at least to someone new to circuit designs) way of keeping an in game timer.

We have a CC out puts two signals, red and green. We set the value of green to 1 and red to the amount we want the inserter to sleep. In this case I set it to 2702, since the clock updates 60 times a second and I want the inserter to sleep for 45 seconds.

We take these outputs and run them to the inputs of a DC, and have the operation be green < red. We set the output to be green (and set the value to input amount). We run this output back to the input, and then you should see the value of green increasing 60 times a second until it hits 2701, where it will reset to 1. That amounts to 2700 ticks, or 45 seconds before it rests.
Timer.PNG
Timer.PNG (71.5 KiB) Viewed 1980 times
Now onto my design...

Step One
We need to know how many items we need, more over we need both how many we want in total, and how many we currently have. So we need to run the current value of the NF in LN B and run it to LN A. I also have a CC outputting a value of 10 using the symbol T for total, and also run that to LN A. For those unaware how this is done, you can simply attach a red or green wire to a power pole, and then daisy chain your way from one to the other.

Step One and a half
This could be done in LN B, but I wanted to keep all of the circuit calculations in one spot. I use one AC to subtract NF from symbol T, which should be the number of NF needed in LN B, and output this as white.


Step Two
We can look online to find the swing time of a fast/stack inserter, which is 2.31 swings per second, or 25.97 updates per swing. We'll round this number to 26.

Using an AC, with the inputs from step 1.5 (white), we multiply it by the 26 value we found above and output this new number as gray.


Step Three
We need to use and AC with an input red (from the CC in our the timer) and the gray value from step 2. Well subtract gray from red, and output this value as black, and then connect this value to the inserter (either directly or through power poles). Also, we need the green value from the timer done in the same fashion.


Step Four
So, we should have and inserter pulling from requster chest in LN A, and inserting onto a belt that carries the NF down LN B. This is the inserter we need the black and green values. In the inserter, set the enabled condition to green > black, and you should see the inserter put only the amount of NF needed onto the belt, and then sleeping for the remainder of the 45 seconds. In that time, the NF will travel the full length of the belt, and go into the necessary chests. The white value calculated in step 1.5 should drop to zero before the inserter wakes back up, making the condition where it wakes up always false.

LN A.PNG
LN A.PNG (1.45 MiB) Viewed 1980 times
LN B.PNG
LN B.PNG (428.19 KiB) Viewed 1980 times


Final Remarks

If you find that the inserter wakes up before the items can travel the length of the belt, you can increase the maximum value of the timer, or you can decrease it if you find to to slow to react to changing volumes of resources in the other LN.


Important Notes
This is all assuming a stack size of 1, since that is the maximum stack size of NF. I am considering expanding this post to include stack size manipulation for other resources needing the same treatment. So if this post is not enough to help you with that problem, feel free to ask and I'll try to tackle it when I'm not busy with another project.

I hope this either helps or impresses anyone upon reading,

Dak31
johnwhile
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue May 08, 2018 10:01 pm
Contact:

Re: Precise Controll Over Inserter Output to Reduce Belt Buffer

Post by johnwhile »

Hi, personaly i'm using this Logic for labs to not waste any unecessary and expensive science pack objects. It's a possible solution for you issue ? ;)
To start process just insert manualy how many item you want on the belt, every time the transport belt at the end read the exit production, send the same request to transport belt at the head.

Image
InOutBelt
(similar here: viewtopic.php?f=193&t=55924#p369225)
Post Reply

Return to “Combinator Creations”