How does splitter sorting work?

Solution 1:

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:

  • [Black Magic] 2 Belt full throughput splitter sorter : factorio
  • [Black Magic Explained] How do belt-based sorters work : factorio <- if you want actual screenshots and not just bad ASCII