Factorio – How Splitter Sorting Works

factorio

In comments to another question, user Marc C posted a very interesting contraption:

enter image description here
[Animated version]

This device manages to separate two mixed belts with copper and iron plates into 4 belts, two having only iron and two having only copper. It manages to do this without using any filter inserters. How exactly does this work?

Best Answer

Black magic, mostly.

Splitters have an interesting property that the decision of which belt to output on is decided per type of item.

So if you have a mixed belt in it will always output half of each type of item on each output belt, order does not matter (if you alternate copper and iron, both output sides will have equal amounts of copper and iron, it won't have one side be copper and one iron). However if you only have 1 of each type of item they will all end up on the same belt, that is each type of item starts on (say, depends on rotation) the left side.

Time for an example with bad ASCII art (with * as splitters and = as belt):

==*=====*==
  *==╝  *==

Let's assume we're sorting iron and copper, his setup will make it so that both the copper and iron input is send to the outer sides of the belt.

Let's zoom in on the end:

------ <- filled with copper and iron
------ <- empty

------ <- empty
------ <- filled with copper and iron

That is, until you manually place an extra copper on the tuning point, offsetting the splitting and suddenly copper is on the inside of the output and iron is on the outside!

==*=====*==
  *==╝  *==
    ╝ <- tuning point

------ <- filled with iron
------ <- filled with copper

------ <- filled with copper
------ <- filled with iron

The complicated mess is needed to a) extract the output from the proper sides of the belt (that's what the underground belts are for, if you input to the side of one only one side of the belt moves) and b) make it take more input at one time.

The danger of this set up is that if it ever backfills it breaks and needs to be cleared and reset, so some circuit logic is needed to make it not break.

Sources: