Page 1 of 1

Set any inserter stack size with just 1 combinator

Posted: Fri Oct 28, 2016 8:56 pm
by hansinator
Edit: I have found a new way of precisely setting the stack size for any inserter with just a constant combinator. The topic name has been changed to reflect that.

The new version can set any inserters stack size via the circuit network by using integer overflow. It works with normal inserters and with filter inserters in "set filters" mode. There is no downside and it will not influence anything (like slowing down the belt) but the stack size. It is not limited to a stack size of 1 like the old version and it uses just one constant combinator instead of nine combinators. Unfortunately this does not work when taking from a chest.

The gif first shows the left inserter with its stack size set to 1 and the right inserter with its stack size set to 2 and filter set to iron plates. In the second part of the gif the left inserter stack size is set to 5 and the right inserter stack size to 1. The nixie tube displays how many items are in the corresponding chest.
Image

It works like this:
Image

The combinator value, let's call it X, is calculated like this:
X = 2147483648 - desired_stacksize

Examples:
* stack size 1 has combinator value 2147483647
* stack size 2 has combinator value 2147483646
* stack size 3 has combinator value 2147483645
..
* stack size 11 has combinator value 2147483637
* stack size 12 (max) needs no combinator..

There is one thing to note. You may only connect one wire type, either red or green, but not both. If you connect both, you need to use this formula:
X = 2147483648 - 2 * desired_stacksize
That is because each wire type will reflect back the hold value to the inserter. Two wire types reflect it twice.

Here's the old post:
old post
Here is the blueprint of the old construction:
old Blueprint

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Fri Oct 28, 2016 9:51 pm
by gheift
Might be possible with just two combinators, I am on mobile, so here a short idea

Inserter: Set filter, Read hand content hold
Decider: Each > 0; Each = 1
Input to to items, which should be filtered, output with red wire to filter inserter
Arithmetic: Each := Each * -2
Input connected with green wire to the inserter, Output connected with red wire to the inserter

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Fri Oct 28, 2016 10:00 pm
by hansinator
gheift wrote:Might be possible with just two combinators, I am on mobile, so here a short idea

Inserter: Set filter, Read hand content hold
Decider: Each > 0; Each = 1
Input to to items, which should be filtered, output with red wire to filter inserter
Arithmetic: Each := Each * -2
Input connected with green wire to the inserter, Output connected with red wire to the inserter
This will make the inserter pick up three items at once. One tick after the inserter outputs a "read items" signal it is already too late to switch it off.

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Sat Oct 29, 2016 12:50 am
by DaveMcW
You can do pick-1 with zero combinators. Feed this contraption with a filter inserter to do filtered pick-1.
pick1.jpg
pick1.jpg (107.13 KiB) Viewed 10417 times

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Sat Oct 29, 2016 7:55 am
by hansinator
DaveMcW wrote:You can do pick-1 with zero combinators. Feed this contraption with a filter inserter to do filtered pick-1.
pick1.jpg
Yeah slowing the belt also works.. but it slows down the belt and reduces throughput! It will also fail and pick up two items when both lanes are used and the belt is backing up. It is of no use to me but others might find it helpful. It's simple indeed.

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Mon Oct 31, 2016 7:07 pm
by Gnark
Hi guys,

You have much more simple and fast.
Connect the inserter to a pool and set :
* Check enable/Disable
* Check Read Hand Contents
* Check Hold
* Enable condition : everything < 1 (you can set 2,3,4 whatever you want your inserter to pick at once but no more)

In fact the inserter will disable itself when it has the requested number in hand ;)

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Mon Oct 31, 2016 7:15 pm
by hansinator
Gnark wrote:Hi guys,

You have much more simple and fast.
Connect the inserter to a pool and set :
* Check enable/Disable
* Check Read Hand Contents
* Check Hold
* Enable condition : everything < 1 (you can set 2,3,4 whatever you want your inserter to pick at once but no more)

In fact the inserter will disable itself when it has the requested number in hand ;)
This does not work with filter inserters when you set the filters via the circuit network, which is what this thread is about.

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Mon Oct 31, 2016 7:48 pm
by Gnark
hansinator wrote:
Gnark wrote:Hi guys,

You have much more simple and fast.
Connect the inserter to a pool and set :
* Check enable/Disable
* Check Read Hand Contents
* Check Hold
* Enable condition : everything < 1 (you can set 2,3,4 whatever you want your inserter to pick at once but no more)

In fact the inserter will disable itself when it has the requested number in hand ;)
This does not work with filter inserters when you set the filters via the circuit network, which is what this thread is about.
Ok sorry see the picture of DaveMcW and it was not a filter inserter.
But even with filter inserter you have the same way of doing it.

Lest say your filter network is the green wire, you set in the green wire the filter with the amount wanted (ex copper = 3)
Connect the green wire to your filter inserter (inserter in filter mode of course then Read Hand Contents and Hold)
Connect a red wire from your inserter to the entry of a calculator set it "each * -3"
Connect the output of the calculator to the green wire (the one already connected to your inserter)

Enjoy

PS : the each mult by '-3' remain the same even if you set copper=1 or 5 or whatever of course

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Tue Nov 01, 2016 4:00 pm
by hansinator
Gnark wrote: Lest say your filter network is the green wire, you set in the green wire the filter with the amount wanted (ex copper = 3)
Connect the green wire to your filter inserter (inserter in filter mode of course then Read Hand Contents and Hold)
Connect a red wire from your inserter to the entry of a calculator set it "each * -3"
Connect the output of the calculator to the green wire (the one already connected to your inserter)
Did you test the construction? It is basically the same that user gheift suggested. It does not work, the inserter will pick more items.

One tick after the inserter outputs a "read items" signal it is already too late to switch it off. So you _must_ use more combinators to produce pulses short enough.

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Tue Nov 01, 2016 4:37 pm
by Gnark
hansinator wrote: Did you test the construction?
Yes was working for me.
I think inserter take at least a tick to pick up item.

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Tue Nov 01, 2016 5:06 pm
by hansinator
I could only get it to pick 3 or 2 items at once but not just one. How did you get it to pick one item only? I exactly reproduced the circuit you posted but it does not work for me.. I am using Factorio v 0.14.17 but the behaviour should be the same as in the latest 0.13 stable release.

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Tue Nov 01, 2016 5:15 pm
by Gnark
I am with the last 0.13 steam release.
Will post you a video if you want.

PS : I also remember that I use this on a yellow belt ... if you try on a blue belt ?
faster belt may cause that inserter take item faster ?

Re: Filter inserter pick 1 item (avoid stack bonus)

Posted: Tue Nov 01, 2016 5:59 pm
by hansinator
Gnark wrote: PS : I also remember that I use this on a yellow belt ... if you try on a blue belt ?
faster belt may cause that inserter take item faster ?
Oh yes that's it! I am only using blue belts.

I have updated the original post and devised a new way of precisely controlling the stack size for any inserter that works with any belt and any inserter.

Re: Set any inserter stack size with just 1 combinator

Posted: Mon Dec 05, 2016 6:49 pm
by justarandomgeek
This can be done with no combinators at all - wire an inserter to a chest. Configure the inserter to read/hold mode, then configure it's enable condition as Every<[your threshold value] or Item<[your threshold value]. The inserter will load the chest to exactly that value, and if possible, do it in a single stack.

Image

Re: Set any inserter stack size with just 1 combinator

Posted: Mon Dec 05, 2016 7:10 pm
by hansinator
justarandomgeek wrote:This can be done with no combinators at all - wire an inserter to a chest.
Did you even read the thread or did you just post your example? -.-
Your solution does not solve the problem for filter inserters and you are not the first one to make this mistake.