Insert a specific amount of items.

Post all other topics which do not belong to any other category.
Post Reply
Terukio
Long Handed Inserter
Long Handed Inserter
Posts: 67
Joined: Mon Mar 21, 2016 11:30 pm
Contact:

Insert a specific amount of items.

Post by Terukio »

Hi all,

I'm trying to create smart furnaces but I keep running into the problem of a furnace getting stuck to due the fact that when the inserters turn off there is still 2 or 3 iron plates in the furnace and it can't make another steel blocking it from making any other type of material.

I'm trying to come up with a way using deciders/arithmetic to make the inserters only insert 5 iron at a time. Is this possible?

Thanks.

The Eriksonn
Fast Inserter
Fast Inserter
Posts: 230
Joined: Wed Jun 08, 2016 6:16 pm
Contact:

Re: Insert a specific amount of items.

Post by The Eriksonn »

Don´t think so, because of the inserter stack size bonus they don´t always pick up the same amount. I would say no on that. Sorry :(

BlakeMW
Filter Inserter
Filter Inserter
Posts: 950
Joined: Thu Jan 21, 2016 9:29 am
Contact:

Re: Insert a specific amount of items.

Post by BlakeMW »

Terukio wrote: I'm trying to come up with a way using deciders/arithmetic to make the inserters only insert 5 iron at a time.
Yes it is possible by inserting from belts. Here is one way:

Link the inserter to any old random thing. Use "Hand read mode" of "hold", and condition "iron < 5". It will now pick up 5 iron and no more (you can delay the signal by 1 tick and it should still work, if you want to convert from iron to another signal - and you probably will).

The problem is how to get it to insert that 5 iron because you can't seperately enable picking up vs putting down.

One solution would be to use the circuit network to actually switch off the belt which leads to the front of the inserter (I would have a splitter which allows the resources to go around). If the belt is clear and the inserter has 5 items in its hand, then send it a signal which lets it insert. As it sees nothing it can pick up, it inserts what is already in its hand.

A final problem is if there are only a few iron plates it can pick up less than 5 and insert them. You could set a condition that only activates it if there are at least 5-6 iron plates on the belt in front of it plus the belt before that one.

This would probably take several combinators, but no-one builds smart furnaces because it's an easy and efficient way to smelt ore, right?

DOSorDIE
Fast Inserter
Fast Inserter
Posts: 249
Joined: Sat Oct 11, 2014 3:43 pm
Contact:

Re: Insert a specific amount of items.

Post by DOSorDIE »

The simple way where, that i can say in the inserter to ignore the Stack Bonus.
But for that we need a mod or the devs built it in.
I have really huge problems to have the Stack Bonus.
Most of my systems is not working because of this.

BlakeMW
Filter Inserter
Filter Inserter
Posts: 950
Joined: Thu Jan 21, 2016 9:29 am
Contact:

Re: Insert a specific amount of items.

Post by BlakeMW »

More thoughts on hand measuring:

When an inserter is switched off it is put in statis, if it was trying to find more items to pick up when it was last on, when switched on again it'll still be trying to find more items.

As such what we need is two XOR condition chains:

Condition which causes picking up:
Iron Plates in front of it > 0
Iron Plates in the hand < 5

Condition which causes inserting into furnace:
Iron Plates in the hand = 5
Iron plates in front of it = 0

If it has < 5 plates in the hand and there are no plates in front of it then it should be put in stasis until more plates come along, or in other words the on signal should only be sent when one of the above two conditions are true and otherwise the inserter is frozen until it can only do the right thing.
Last edited by BlakeMW on Wed Jul 06, 2016 11:04 am, edited 1 time in total.

Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: Insert a specific amount of items.

Post by Zeblote »

You could make an inserter from belt to ground and have another one pick up the items one by one maybe?

Neotix
Filter Inserter
Filter Inserter
Posts: 599
Joined: Sat Nov 23, 2013 9:56 pm
Contact:

Re: Insert a specific amount of items.

Post by Neotix »

I think it won't work because inserter will grab few items and place one on ground but still hold rest. When next inserters grab item from ground it will also grab items held by first inserter because it will put them on ground one after another.

The only way i can think is using belts connected to circuit network and allowing to pass through only specific amount of items.

Tnarg
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Tue Apr 19, 2016 8:23 am
Contact:

Re: Insert a specific amount of items.

Post by Tnarg »


Neotix
Filter Inserter
Filter Inserter
Posts: 599
Joined: Sat Nov 23, 2013 9:56 pm
Contact:

Re: Insert a specific amount of items.

Post by Neotix »

I think that I found a solution :D

Image

We have to place items only on one side of the belt to make it precise.

First belt have condition to work when required item is less then required amount.
https://i.gyazo.com/359d1d9641e2cbeece8 ... 763164.png
Second belt and stack inserter have condition to read contend with hold option.
https://i.gyazo.com/78ebfad28ce2eb15ddb ... bf617c.png
https://i.gyazo.com/7aced35d1f4b90659d4 ... 3e0a1d.png
I connected chest only to check if it works each time.

Jupiter
Fast Inserter
Fast Inserter
Posts: 174
Joined: Thu Jun 23, 2016 2:38 pm
Contact:

Re: Insert a specific amount of items.

Post by Jupiter »

I've done it using an aritmatic combi and a constant combi (note, I came up with a better solution in Edit2):

Image
Image ImageImage

Instructions:
Have the constant combinator output the number of items you want the inserter to grab at a time (in the screenshot I used 3 coal) and connect it with green to the inserter.
Have the inserter read its hand contents, set it to 'Set filters' and put 'Hand read mode' on hold.
Connect a red wire from the inserter to the input of the arithmetic combi and a green wire from the inserter to the output of the arithmetic combi.
Let the arithmetic combi multiply the input coal signal with -3 and output the result on coal.

How this works is that the system will keep track of a running total of coal still to grab. The inserter will read 3 on coal from the constant combi. That means it will set its filter to coal. As soon as it grabs one coal it outputs 1 on the coal signal on both the red and green network. The next cycle the arithmetic combi will read 1 on coal and output 1 * -3 = -3 on coal. The cycle after that the inserter will read the following things:
On red circuit:
  • 1 coal (which the inserter itself wrote to that network, it doesn't have its input and output separated like combinators do)
On green ciruit:
  • 1 coal (which the inserter itself wrote to that network)
    3 coal (from constant combi)
    -3 coal (from arithmetic)
It adds it all up for a total of 2 coal. So the inserter keeps its filter and grabs a second coal. Now the arithmetic combi will output -6 and the total coal signal the inserter will see is 2 on red + 2 on green + 3 on green + -6 on green = 1. After grabbing a 3rd the coal signal will become 0 and the inserter looses its filter and goes dorment (but lays down the coal it grabbed).

Edit:

I've tested my setup in various situations and it seems that it doesn't behave that well. It works perfectly if it's grabbing from a fully compressed belt (either 1 lane or 2 lanes as long as either lane is fully compressed) but not if the items are sparsely scattered. Then it tends to grab an extra item.
When grabbing from a chest it doesn't work at all. It always grabs 5-6 items. I think this has to do with that my system has a response time of several ticks (3 I think) which is simply too slow. I think that every combinator solution will suffer from this.

Edit 2:
I've managed to improve the grabbing from belts (not from boxes unfortunately). I had to abuse the internal workings of factorio a bit though. Now I have just the inserter and a constant combi connected by a red wire. The constant combi outputs 2 separate coal signals: signal 1 = <limit you want> * (-1) - 1 (so if you want 3 then set to -4). Signal 2 = 2147483647. Combined with the output of the inserter self (hand content) this will result in a arithmetic overflow of the 32-bit signed integer used to store the signals value upon the inserter reaching the limit. The total of the big number, the -4 and the 3 from the inserter will result in 0, thus taking away the filter of the inserter. Now it behaves perfectly regardless of belt compression because there is no delay anymore. I can provide a screenshot if wanted.

Post Reply

Return to “General discussion”