Hi, I am relatively new to the game. I am looking for a solution since a couple days but can't find anything (the wiki is rather small).

A picture is worth a 1000 words :

So I fill both sides of the belt from my miners. I then want to evenly (from both side of the lane) put the iron one side of a new belt. Unfortunately, when the outside lane is full, it completely runs over the inside lane. It does the same thing with the copper. It might not be a big deal but it is annoying. The problem is that some of my miners are doing nothing while some are getting depleted. I know I could fix it with an inserter or two but I want to know if their is a solution with belt/splitters.

Personally I run my coal down it's own dedicated conveyor, so that the iron/copper can flow more freely. I find when you have only one half of a conveyor sending raw materials down eventually when you reach a certain number of furnaces you simply won't be able to reach the far ones even if you have plenty of resources, just because of the trickle rate.

you could even out the iron or copper belts with splitters.
In your picture, put a splitter right where your character is standing. Build it that the left side of the splitter exits to your normal iron belt. The right side from the splitter should be free. Then, just build one belt with a left turn after this free exit of the splitter, so that the right side of the splitter feeds into the right side of the belt.

With this setup, the splitter takes some of the iron from the left side and puts it on the right side and should even your stalled lane. For a more advanced setup, you could do this 2 times(one left and one right) at the start of a long belt line. In this case, the iron from you mines would automatically placed on the side of the belt which is free, if one is stalled.

Assuming full-belt input, one can convert it to balanced half-belt output using the following 4x4 unit:
It uses the underground belt trick (one is fast to avoid two halves clamping together) to split lanes, then one lane is switched (left -> right or vice-versa), then two one-sided lanes go through splitter (which alternates the input).
And so the output is a single lane with items alternating from original full-belt input.
You can do the same without the fast u-belt piece, but the design will become 4x6.

Oh, and while we're at it: it is NOT possible to make a perfect deterministic (producing the same definitive result no matter the system's state) alternator using only belts. The reason is simple -- a splitter, when joining two belts, prefer its left side if its output is clogged -- so in case of a clogged system one lane will still be preferred (though the other lane will be moved occasionally, instead of completely stalling).
To achieve a fully deterministic 1-left lane 1-right lane output, you can do this logic gate:
There's so much wires only because I'm testing it with 2 separate items, the logic becomes more simple if both input lanes transfer the same item. The only "trick" here are in two first inserters -- both prefer to pick from different lanes (the top one picks from the left lane, the left one picks from right lane).

Needless to say, though, this design work with only 1/2 basic belt throughput; so to fully alternate even the basic belt, you'll need to split the input and make two separate gates. Then you can mix the output using splitter, as it doesn't matter if splitter joins already sorted input unevenly. There will be occasional 2-1 or 2-2 artifacts, instead of perfect 1-1-1-1-etc, but in general, both lanes of the input will always be used evenly.

Oh, and if you need to perfectly split an express belt... you'll need A LOT of inserters and A LOT of space.

Interesting solution!
I guess you've set the first two smart inserters to only pick items from the belt when the last box is (almost) empty? Thus ensuring that they both will always be able to offload their items, or they both stop at the same time.

But why do you need those other two smart inserters that move the items to the last box? Couldn't they just be fast inserters?

No, it's actually not wired that way.
First pair of inserters: pick only their corresponding item, pick only 1 (linked to their respective chest with <1 condition).
Second pair of inserters: pick only when the last box is completely empty (red wire: item 1 <1, green wire: item 2 <1).
Why it must work like that: the gate's chokepoint is its last inserter -- it outputs items twice as slow as the rest of the gate can process them (obviously, since it's 2 inserters vs. 1). So conditions must be set in such a way so it's not possible that more than 2 items (1 of each kind) could be in the last box per gate's "tick". That is -- two items arrive in the last box, BOTH are removed, and only then two new may arrive.

It is deterministic only if input is balanced (that is, one lane of input can't become empty while other is full). If one lane becomes empty, it'll start outputting just the item from non-empty lane. But to make a fully deterministic alternator gate (always 1-1-1-1 output whenever possible, stops if it's not possible) -- is much harder. Probably impossible without a "timer" circuit.

Okay, so you (all of you, yes!) goaded me into making a perfect deterministic alternator. After lots of thinking and some wasted hours, I actually made one. So this will be a lengthy post about it.

Premises:
1) Given a 2-items belt input, make a machine that will produce a 1-1 mix of those items into the output.
2) The machine should work as fast as possible.
3) The machine should be as compact as possible.
4) If the input is unsuitable to produce 1-1 mix, the machine should stop.

Thoughts:

Making this without some sort of a control loop is not possible, as there's a "hardware" limitation of having only 2 conditions max per one smart inserter (and the alternator requires 3-4 in some places). So, the control loop must be used to "compress" 2 conditions into 1. Think of it as a mechanical analogue to braces.

Maximum possible throughput of such an alternator equals to 1 fast inserter throughput. Making a deterministic alternator with 2 output inserters is not possible, as it is not protected from clogged output (one inserter will become clogged before the other, thus producing all sorts of 2-1 or 2-2 artifacts even with all possible logic overflow protection).

The alternating system can work with split input and thus produce output with greater speeds (using several alternators together), but the result is not guaranteed to be 1-1 mix, as each splitter (used to join the output) can introduce errors. Thus, with 2 alternators outputting to 1 splitter, the result could become 2-2 (as well as with all kinds of 2-1 artifacts), with 4 alternators (and 3 splitters) -- 4-4, and so on. However, it's still guaranteed that the error won't become larger than splitter count, and it's also guaranteed that both input items are always used proportionally, thus a sufficiently large batch of output items will maintain 50%-50% split ratio, even with splitter-introduced errors. So the machine, despite some quirks, is quite modular.

Now, the schematics:
1)
A "base" variant. Has the maximum -- 1 fast inserter -- throughput (note the equal distances between items in the output), but as you can see, it produces 2-1 artifacts when the input becomes unbalanced (a shortage of item1 will produce 2 pieces of item1 when it becomes available again, same with item2). So, if there are frequent shortages of one item in the input, the output could become pretty unbalanced.
However, the basic idea was good enough, so I'll be doing most of my explanations on this schematic. The "perfect" variant is just a slight upgrade of it.

2)
The final "perfect" variant. Always produces the required 1-1 mix, no matter what (short of biters eating parts of the machine). However, it's still not absolutely perfect, as it skips a beat between outputting each pair of items (note the uneven distances between items in the output).

Now, here comes the hard part: explanations.

Expand

1. The layout.
The machine comes with 2 separate modules that doesn't even need to be close. The only requirement is a 2-way logic circuit connection: the synchronization circuit must be connected with 1 color wire to the alternator, and the alternator must be connected with (another) 2 color wires back to the synchronization part.

The alternator is a 3x4 unit, consisting of 2 electric poles, 4 smart inserters, 3 smart chests, and 1 output inserter (fast or smart, depending on schematic). The synchronization circuit is a symmetrical loop of 2 parts (so each part have the same functionality as the other one, two are used only to provide a loop); consisting of 1 electric pole, 2 smart chests, 2 simple chests, and 4 smart inserters.

2. The flows.
Self-explainable. I haven't captured a "detailed info" screen, so I'm posting this one instead. The synchronization circuit moves one item (any item) between chests.

Huh, so any kind of separate circuits weren't even needed Good to know, that makes things much more simple.

Any kind of wiring solution tend to grow in complexity up until the point you realize that half of it isn't even needed.

EDIT: Ah, no, I'm pretty sure that your system produces the same errors as my #1 schematic -- i.e. 2-1 splits when the system recovers from 1-side input shortage.
1) A state of shortage: 1 item in one of the first boxes, 0 in other one, only 1 item in the last box, output inserter stopped.
2) Recovering: 1 other item comes in the first box, output restarts and removes that 1 leftover item from the last box.
3) Then 2 middle inserters put their items in the last box.
Question: which one will be picked next by the output inserter?

just_dont wrote:
Any kind of wiring solution tend to grow in complexity up until the point you realize that half of it isn't even needed.

I have that a lot too

just_dont wrote:
EDIT: Ah, no, I'm pretty sure that your system produces the same errors as my #1 schematic -- i.e. 2-1 splits when the system recovers from 1-side input shortage.
1) A state of shortage: 1 item in one of the first boxes, 0 in other one, only 1 item in the last box, output inserter stopped.

I've tried it quite a bit, and have not had that happen. The thing is, when one side runs dry, the system stops with *two* items in the last box, because the last inserter can not work unless there is 1 item in each of the first two boxes. So the state you suggest there can not happen.

1) Inserter 5 picks the last item from box 3 -> inserter 3&4 start to move their item from box 1&2 to box 3
2) Box 1&2 are empty, so inserter 1&2 try to move an item, but one of them can't
3) Inserter 5, 3&4 finish the move of their item. And one of the inserters 1&2 finish its move
Now there are 2 items in box 3, and 1 item in box 1 or 2. The other box is empty.
Inserter 5 can not start on those last two items, inserter 3&4 stop because box 3 is not empty.

just_dont wrote:
Question: which one will be picked next by the output inserter?

I have no clue how that output inserter decides what to pick, but for some reason the order is always the same...

Wire two intermediate chests to one pole, the last one to another pole, both wires. Wire last inserter to pick only when intermediate chests have =1 of both items. Wire intermediate inserters to pick only when last chest doesn't (<1) have both items. Wire first two inserters to filter-pick each of the two input items, and pick only when intermediate chests don't have their corresponding item (item1 <1 if inserter picks item1, item2 for other inserter).

I made an alternator which is far from perfect but is kind-of deterministic and works for any number of incoming materials (here it is tested with 6) :

the upper chests giving the tick for inverters by moving the fuel (anything) by one if there is an output possibility in the chest, are linked to each of the 6 chest by green cables. the inputs are limited to 1 (in green circuit) of input and they take it when there is a coal in the next tick. the out puts put it out when it is their tick.
the order of output is dependent on how the belts are put together and need a bit of testing for each configuration (so in max speed they will still be in order). once set up this is slow but reliable way of putting things in desired order ,just need to be sure there wont be an overload, by assuring the output at the end. I have tested the case where one material is not coming, it should work (the split will be stopped until all lanes are providing). if you want to make more then one lane of the same material you should limit the ticks for more then 1 inserted or put the green wires more separately.

to speed things up you could put the tick-chests in a circle. or if you have many lanes i guess you can slow them down a bit by additional slow-inserter steps => more time between outputs so they will be easier to co-ordonate in the arriving lane.

I use this layout. Without the stack limit on the bottom left smart chest, it can get in a state where it starts moving only a single color. This layout is very forgiving of wiring, you can wire all colors to all inserters and chests, and as long as you set the conditions right, it will work. The underground belts aren't needed, but I use them to keep everything linear, and be able to run series of belts across the map, and split out the desired combination at any point without interrupting belt flow