Set any inserter stack size with just 1 combinator

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.
Post Reply
User avatar
hansinator
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sat Sep 10, 2016 10:42 pm
Contact:

Set any inserter stack size with just 1 combinator

Post by hansinator » Fri Oct 28, 2016 8:56 pm

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
Last edited by hansinator on Tue Nov 01, 2016 6:05 pm, edited 7 times in total.

gheift
Fast Inserter
Fast Inserter
Posts: 184
Joined: Tue Mar 03, 2015 9:20 pm
Contact:

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

Post by gheift » Fri Oct 28, 2016 9:51 pm

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

User avatar
hansinator
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sat Sep 10, 2016 10:42 pm
Contact:

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

Post by hansinator » Fri Oct 28, 2016 10:00 pm

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.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 2870
Joined: Tue May 13, 2014 11:06 am
Contact:

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

Post by DaveMcW » Sat Oct 29, 2016 12:50 am

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 4877 times

User avatar
hansinator
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sat Sep 10, 2016 10:42 pm
Contact:

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

Post by hansinator » Sat Oct 29, 2016 7:55 am

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.

Gnark
Inserter
Inserter
Posts: 41
Joined: Tue Oct 18, 2016 10:15 am
Contact:

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

Post by Gnark » Mon Oct 31, 2016 7:07 pm

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 ;)

User avatar
hansinator
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sat Sep 10, 2016 10:42 pm
Contact:

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

Post by hansinator » Mon Oct 31, 2016 7:15 pm

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.

Gnark
Inserter
Inserter
Posts: 41
Joined: Tue Oct 18, 2016 10:15 am
Contact:

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

Post by Gnark » Mon Oct 31, 2016 7:48 pm

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

User avatar
hansinator
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sat Sep 10, 2016 10:42 pm
Contact:

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

Post by hansinator » Tue Nov 01, 2016 4:00 pm

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.

Gnark
Inserter
Inserter
Posts: 41
Joined: Tue Oct 18, 2016 10:15 am
Contact:

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

Post by Gnark » Tue Nov 01, 2016 4:37 pm

hansinator wrote: Did you test the construction?
Yes was working for me.
I think inserter take at least a tick to pick up item.

User avatar
hansinator
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sat Sep 10, 2016 10:42 pm
Contact:

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

Post by hansinator » Tue Nov 01, 2016 5:06 pm

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.

Gnark
Inserter
Inserter
Posts: 41
Joined: Tue Oct 18, 2016 10:15 am
Contact:

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

Post by Gnark » Tue Nov 01, 2016 5:15 pm

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 ?

User avatar
hansinator
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sat Sep 10, 2016 10:42 pm
Contact:

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

Post by hansinator » Tue Nov 01, 2016 5:59 pm

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.

justarandomgeek
Fast Inserter
Fast Inserter
Posts: 230
Joined: Fri Mar 18, 2016 4:34 pm
Contact:

Re: Set any inserter stack size with just 1 combinator

Post by justarandomgeek » Mon Dec 05, 2016 6:49 pm

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

User avatar
hansinator
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sat Sep 10, 2016 10:42 pm
Contact:

Re: Set any inserter stack size with just 1 combinator

Post by hansinator » Mon Dec 05, 2016 7:10 pm

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.

Post Reply

Return to “Combinator Creations”

Who is online

Users browsing this forum: No registered users