Demand rebalancer/inverse rebalancer

Circuit-free solutions of basic factory-design to achieve optimal item-throughput.
Involving: Belts (balancers, crossings), Inserters, Chests, Furnaces, Assembling Devices ...
Optimized production chains. Compact design.
Please provide blueprints!
Forum rules
Circuit-free solutions of basic factory-design to achieve optimal item-throughput
User avatar
Jackalope_Gaming
Fast Inserter
Fast Inserter
Posts: 224
Joined: Wed Oct 07, 2015 10:11 pm

Re: Demand rebalancer/inverse rebalancer

Post by Jackalope_Gaming » Sat Jan 28, 2017 2:30 pm

Here's a lane balancer that doesn't use underground belts:

Image

Also doubles as a count perfect 2 to 1.

User avatar
Bilka
Factorio Staff
Factorio Staff
Posts: 1015
Joined: Sat Aug 13, 2016 9:20 am

Re: Demand rebalancer/inverse rebalancer

Post by Bilka » Sat Jan 28, 2017 3:01 pm

That design is nothing new, mechanically it's the same as this:
Image
Samky wrote: However the one I posted a picture of a few posts ago was under the lane balancer section. It certainly pulls evenly from the lanes it pulls from, true, but it also ignores two of the lanes. For example output lane 1 pulls only from input lanes 1 and 3. The wiki page says they "pull evenly from the input lanes when the output is backed up. They are input and output balanced."
I just saw in your post with the screenshot that the underground belt that receives the plastic is the wrong direction. When you fix it the balancer should be perfect.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

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

Re: Demand rebalancer/inverse rebalancer

Post by hansinator » Sun Jan 29, 2017 4:02 am

Samky wrote:Now I'm a little excited. My design is much better. This one only distributes the even inputs to the even outputs and the odd inputs to the odd outputs. Look how easy it was to clog it.
Yes the 2-belt version is not perfect under all circumstances, but the 1-belt version truly is. The 2-belt version is cheaper, but you can also use two of the 1-belt ones and use another splitter to mix the outputs. Then it works perfect. It just needs more splitters and they are expensive. Usually both will be fine.

edit:
@Bilka
The wiki page you made is really nice. That is the definitive answer to all these belt threads :)
I assume the throughput losses you describe there have to do with this phenomenon viewtopic.php?f=5&t=25008 ?
I've built dozens of test setups to investigate that and I've got some hand-drawn diagrams that outline the theory of what happens and why it can't be mitigated easily. I'd like to contribute a small section about the theory (nothing mathematical, just a simple explanation of item flow) behind it to the wiki page, if possible?

edit2:
I've made a small gif to illustrate the difference between input/output lane-balancers and output-only lane-balancers. Maybe it could be included into the wiki page to quickly give a better understanding?
Image

jdtunn
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu Apr 28, 2016 7:58 pm

Re: Demand rebalancer/inverse rebalancer

Post by jdtunn » Sun Jan 29, 2017 8:22 am

Samky wrote:
hansinator wrote:Image
Image

These are the best lane re-balancers I know of. They always take balanced from the input lanes. Found here: https://imgur.com/a/sgAsj#lsEagUO
Now I'm a little excited. My design is much better. This one only distributes the even inputs to the even outputs and the odd inputs to the odd outputs. Look how easy it was to clog it.

Image

In my design, each individual output lane takes equally from each individual input lane. Not only is it balanced, but it's impossible to clog.

Image

(test with 200 items in each lane, with blocked output lanes 1 and 3. Result shown bottom center)
I hope you realize the reason it's clogging up is cause you have an underground belt running backwards

Image

User avatar
Bilka
Factorio Staff
Factorio Staff
Posts: 1015
Joined: Sat Aug 13, 2016 9:20 am

Re: Demand rebalancer/inverse rebalancer

Post by Bilka » Sun Jan 29, 2017 2:33 pm

hansinator wrote:
edit:
@Bilka
The wiki page you made is really nice. That is the definitive answer to all these belt threads :)
I assume the throughput losses you describe there have to do with this phenomenon viewtopic.php?f=5&t=25008 ?
I've built dozens of test setups to investigate that and I've got some hand-drawn diagrams that outline the theory of what happens and why it can't be mitigated easily. I'd like to contribute a small section about the theory (nothing mathematical, just a simple explanation of item flow) behind it to the wiki page, if possible?

edit2:
I've made a small gif to illustrate the difference between input/output lane-balancers and output-only lane-balancers. Maybe it could be included into the wiki page to quickly give a better understanding?
Image
Thank you, it has been some hard work :)
Yes, the throughput losses have to do with exactly that phenomenom. All the balancers currently on the page have at least a min throughput of 50% though, so the issue is not too big.

Of course you can contribute to the page! If you already have a wiki account, just edit the page and I'll have a look at it :) To the gif: Looks nice, though it would be better if you would also show how the items are taken off the beltt after the first balancer to make it more clear what is going on.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

huliosh
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Sun Nov 27, 2016 12:04 pm

Re: Demand rebalancer/inverse rebalancer

Post by huliosh » Sun Jan 29, 2017 3:13 pm

Untitled Project.gif
Untitled Project.gif (1.11 MiB) Viewed 3191 times
Splitter? Never heard of it..

zytukin
Fast Inserter
Fast Inserter
Posts: 211
Joined: Sat Mar 12, 2016 12:14 am

Re: Demand rebalancer/inverse rebalancer

Post by zytukin » Sun Feb 05, 2017 12:31 am

Ephron wrote:No, That won't work, because if demand comes only from e.g. the right lane, a full belt will cause this:
Image
and nothing will be gained.
Stick it halfway down the line of buildings demanding the items.
For example, 5 assemblers pulling off the right side, then that balencer then 5 more assemblers pulling off the right side.

Or ideally, run the belt between two rows of buildings so both sides are being pulled from equally.
For example, a belt of ore between two rows of smelters. The smelters will pull ore from both sides of the belt. The output belts from both sides will be one sided, but they can come together in a T shape to yield one belt of plates/steel on both sides.

zytukin
Fast Inserter
Fast Inserter
Posts: 211
Joined: Sat Mar 12, 2016 12:14 am

Re: Demand rebalancer/inverse rebalancer

Post by zytukin » Sun Feb 05, 2017 12:38 am

hansinator wrote: edit2:
I've made a small gif to illustrate the difference between input/output lane-balancers and output-only lane-balancers. Maybe it could be included into the wiki page to quickly give a better understanding?
Image
That inserter is pulling off both sides of the belt.
Would that design work with a normal inserter that only pulls off one side?

Mehve
Filter Inserter
Filter Inserter
Posts: 314
Joined: Sat Aug 06, 2016 9:12 pm

Re: Demand rebalancer/inverse rebalancer

Post by Mehve » Sun Feb 05, 2017 2:11 am

zytukin wrote:That inserter is pulling off both sides of the belt.
Would that design work with a normal inserter that only pulls off one side?
That's just because the inserter is pulling faster than a single lane of yellow belt can provide, although the majority of the pulled items are still from the closer side. But yes, the design works just fine, no matter which side the items are pulled from. In a properly designed lane-balancer, ANY input lane can end up on any output lane.

Tubig
Burner Inserter
Burner Inserter
Posts: 14
Joined: Thu Apr 07, 2016 1:56 pm

Re: Demand rebalancer/inverse rebalancer

Post by Tubig » Tue Feb 07, 2017 3:48 am

hansinator wrote:Image
This style of balancer does not work as desired.

The only reason that it appears to work in this gif is because the item types are different on each side of the input belt. If both sides of the input belt have the same item type, then you cannot be assured that it will pull evenly from both lanes. The only reason that the setup on the right appears to pull from both lanes evenly is because the splitters are shuffling the two input items and the inserter is then picking up alternating iron/copper plates from the near side of the belt, causing the alternation between iron and copper plates to be fed into the splitters.

Both of the setups show in this gif will have the same effect if the input belt is loaded with a single item type (ie all iron plate instead of iron on right and copper on the left): both setups will drain resources from the opposite input lane that the output lane drains. If an inserter is drawing resources from the left output lane, the right input lane will be drained before the left input lane moves and vis versa.

Splitters only ensure that for each item type they alternate which belt they use for output. Splitter do NOT balance between lanes.

Splitters do NOT ensure that they pull evenly from input belts. Only when the output belts have a fast flow of resources does a splitter draw evenly from both input belts. If the output belts are pulling resources slowly, a splitter will pull from one input belt and not the other.

Splitters and belts are terrible at load balancing: I have not found any way to ensure that two (or more) inputs are drained evenly without using circuit networks. However, they work great for load prioritisation: it is relatively easy to ensure that one input is drained before another.

User avatar
Bilka
Factorio Staff
Factorio Staff
Posts: 1015
Joined: Sat Aug 13, 2016 9:20 am

Re: Demand rebalancer/inverse rebalancer

Post by Bilka » Tue Feb 07, 2017 2:01 pm

Tubig wrote: Both of the setups show in this gif will have the same effect if the input belt is loaded with a single item type (ie all iron plate instead of iron on right and copper on the left): both setups will drain resources from the opposite input lane that the output lane drains. If an inserter is drawing resources from the left output lane, the right input lane will be drained before the left input lane moves and vis versa.

Splitters only ensure that for each item type they alternate which belt they use for output. Splitter do NOT balance between lanes.

Splitters do NOT ensure that they pull evenly from input belts. Only when the output belts have a fast flow of resources does a splitter draw evenly from both input belts. If the output belts are pulling resources slowly, a splitter will pull from one input belt and not the other.
The splitters do not ensure that, true. That's why we have lane balancers. The lane balancer ensures that the first splitter pulls evenly from the input belts.
Tubig wrote: Splitters and belts are terrible at load balancing: I have not found any way to ensure that two (or more) inputs are drained evenly without using circuit networks. However, they work great for load prioritisation: it is relatively easy to ensure that one input is drained before another.
Then you are doing it wrong. Have a look at this page: https://wiki.factorio.com/Balancers . All the belt balancers are input balanced, which means that they drain their input belts evenly. (No, not the input lanes, the input belts. If you want to drain multiple belt lanes evenly, have a look at the input and output balanced lane balancers.) Don't believe me? Test the balancers. They work.

Here is the proof that the lane balancer on the right does what it should do: Only the left lane of the output belt is being drained. The balancer on the left only drains the right input lane first. The lane balancer on the right does what it should: It drains the lanes evenly.
Image
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

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

Re: Demand rebalancer/inverse rebalancer

Post by hansinator » Tue Feb 07, 2017 10:19 pm

Here's an updated GIF that compares all sorts of relevant setups. This should ultimately answer all questions and put an end to any doubts. I've taken care that the inserters only take one item a time from one belt side. Maybe you can include that in the wiki page @bilka. Or would you want a smaller subset?

Image
Tubig wrote:The only reason that it appears to work in this gif is because the item types are different on each side of the input belt. If both sides of the input belt have the same item type, then you cannot be assured that it will pull evenly from both lanes. The only reason that the setup on the right appears to pull from both lanes evenly is because the splitters are shuffling the two input items and the inserter is then picking up alternating iron/copper plates from the near side of the belt, causing the alternation between iron and copper plates to be fed into the splitters.
The above GIF definitively proves you wrong. Maybe you should invest more time validating your claims by experiment to avoid posting wrong ones.

Samky
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Jan 26, 2017 1:46 am

Re: Demand rebalancer/inverse rebalancer

Post by Samky » Thu Feb 09, 2017 7:09 pm

So I was thinking of making a big factory, and saw people make good use of 4 belt input. Here's my design for a 4 to 4 that does what the 2 to 2 did. Also I'll explain it so you could easily (maybe) make it for even more belts with a little tinkering.


How the piece below functions:
INPUT of any single odd numbered lane -> OUTPUT to all odd numbered lanes equally
INPUT of any single even numbered lane -> OUTPUT to all even numbered lanes equally

Image



How the piece below functions:
INPUT either lane -> OUTPUT divides equally between both lanes

Image



Put them together and you get the piece pictured below
INPUT any lane -> OUTPUT divides equally to all output lanes

Image



By the way the piece pictured below I saw online a few times. As far as I can tell it's functionally identical to the first piece pictured (outputs odd to odd and even to even) except it uses more items. Intuitively, its advantage would be it doesn't bottleneck as you might think my first picture does by going through 1 splitter. But I tested this and they have the same throughput (which I didn't expect, but I guess that's how splitters work).

Image

Samky
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Jan 26, 2017 1:46 am

Re: Demand rebalancer/inverse rebalancer

Post by Samky » Thu Feb 09, 2017 7:25 pm


I hope you realize the reason it's clogging up is cause you have an underground belt running backwards

Image
I copied the picture, but it looks like you're right, that it's backwards.

Oh, I see what I did. I didn't use the underground belt trick where you make an input an output. I actually didn't know that trick until today.
Last edited by Samky on Thu Feb 09, 2017 9:28 pm, edited 1 time in total.

Samky
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Jan 26, 2017 1:46 am

Re: Demand rebalancer/inverse rebalancer

Post by Samky » Thu Feb 09, 2017 8:10 pm

hansinator wrote:Here's an updated GIF that compares all sorts of relevant setups.

Image
Thanks for this. I'll use it.

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

Re: Demand rebalancer/inverse rebalancer

Post by hansinator » Thu Feb 09, 2017 10:20 pm

Samky wrote: How the piece below functions:
INPUT either lane -> OUTPUT divides equally between both lanes

Image
This one is not reliable, it quickly starts to fail. Watch this example where it does no balancing at all:

Image
And yes, it fails the same way with blue belts.

Samky wrote:By the way the piece pictured below I saw online a few times. As far as I can tell it's functionally identical to the first piece pictured (outputs odd to odd and even to even) except it uses more items. Intuitively, its advantage would be it doesn't bottleneck as you might think my first picture does by going through 1 splitter. But I tested this and they have the same throughput (which I didn't expect, but I guess that's how splitters work).

Image
This balancer has clearly (!) double the throughput than the one you posted. See for yourself:

Image
And yes, it is the same with blue belts.
Samky wrote: I copied the picture, but it looks like you're right, that it's backwards.
I re-made it with it turned around and had the same problem. I even added another underground tunnel to try to make it work and it didn't. I mean, it works, but it doesn't balance each input to each output.
You are right, it is not good at balancing the output lanes, but it balances the output belts properly and it takes balanced from the input lanes.
Here's a comparison of all input-lane combinations (excluding all empty and all full) to show how it balances with unblocked outputs:

Image
(the original image is larger, right-click the image and select "view image" to see it)

So far it is not different from a single splitter - it makes sure the items are spread 50/50 to the outputs. But look how it performs when one output is blocked:

Image

There you can see that it is able to re-balance both left-side lanes of two belts onto the left and right lane of one belt. This is not possible with belt balancers, because they can't switch the lanes. This means it is not necessary that the output lanes of each belt are perfectly balanced. If one lane blocks the other lane gets filled.

The following video demonstrates that it pulls evenly and fair from all its four input lanes even when only one output lane is used. This is also not possible with belt balancers, because they can not switch lanes. The left example shows how it works with belt balancers - it only pulls evenly from one side of the belt.

Image

This also means that it is not necessary that the output lanes of each belt are perfectly balanced. If you have a consumer that takes only from one belt side it will still pull evenly from all four input lanes. So you can see it does all the things that are important about lane balancers.

If you want fair input and perfectly balanced outputs you must use this one. Simpler combinations do not work, trust me, I have tested it.

Image

I hope this clarifies everything. May I suggest you test your builds more thoroughly? ;-)

Nich
Fast Inserter
Fast Inserter
Posts: 171
Joined: Wed Jan 18, 2017 2:33 am

Re: Demand rebalancer/inverse rebalancer

Post by Nich » Fri Feb 10, 2017 2:56 pm

What value do lane balancers add? If anything they just increase the amount of product wasted on a belt. If the product backs up into the forging area it is going to stop 4 forges on the left side or 4 forges at the end (if it is balanced). Either way things will reach an equilibrium. Also what is the point of belt balancers if you are using product 1 blue belt can only support 2 reds, 1 red can only support 2 yellows and 1 yellow can only support 2 half lanes. I am surprised I have not seen more factories with a shrinking main bus. NamelessPC has a beautiful example viewtopic.php?f=204&t=40605

Mehve
Filter Inserter
Filter Inserter
Posts: 314
Joined: Sat Aug 06, 2016 9:12 pm

Re: Demand rebalancer/inverse rebalancer

Post by Mehve » Fri Feb 10, 2017 9:12 pm

Nich wrote:What value do lane balancers add? If anything they just increase the amount of product wasted on a belt. If the product backs up into the forging area it is going to stop 4 forges on the left side or 4 forges at the end (if it is balanced). Either way things will reach an equilibrium. Also what is the point of belt balancers if you are using product 1 blue belt can only support 2 reds, 1 red can only support 2 yellows and 1 yellow can only support 2 half lanes. I am surprised I have not seen more factories with a shrinking main bus. NamelessPC has a beautiful example viewtopic.php?f=204&t=40605
True, belt balancers are rather over-used, and in places they really aren't needed, but they DO have their place. Trains are a big area where they shine (although circuit methods compete heavily here), since they let you load and unload a train evenly across multiple cars, which maintains full throughput to the end.

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

Re: Demand rebalancer/inverse rebalancer

Post by hansinator » Sun Feb 12, 2017 4:48 pm

Nich wrote:What value do lane balancers add? If anything they just increase the amount of product wasted on a belt. If the product backs up into the forging area it is going to stop 4 forges on the left side or 4 forges at the end (if it is balanced). Either way things will reach an equilibrium. Also what is the point of belt balancers if you are using product 1 blue belt can only support 2 reds, 1 red can only support 2 yellows and 1 yellow can only support 2 half lanes. I am surprised I have not seen more factories with a shrinking main bus. NamelessPC has a beautiful example viewtopic.php?f=204&t=40605
There are quite a few examples when it comes to furnaces. If you have an odd number of furnaces or an odd number of furnaces with the same speed outputting to one belt then you inevitably will get imbalances and need to re-balance. It mostly matters when beacons come into play. See this example from vanattefeldt: viewtopic.php?f=202&t=33375

Another thing is that due to slight overproduction the furnaces tend to fill up their output buffer when you output a fully compressed belt. That overproduction can't really be avoided. If you do the math you're always left with fractional numbers of furnaces you would need to precisely fill a belt, except for electric furnaces without any (or an even numbered) speed modifier on blue belts. Overproduction means waste of electricity for idle furnaces and beacons. I use two solutions for this: Either output to more than one belt or throttle the furnaces. Throttling again causes imbalances on the one belt that require lane-balancers to get around. Outputting to more than one belt will leave you with half-filled belts. What I do here is join multiple half-filled belts from multiple furnaces to produce fully compressed belts. For that I need belt and lane-balancers and overflow splitters. Once you have a couple dozen iron/copper belts running through your base it starts to matter, at least for me.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 10393
Joined: Tue Apr 16, 2013 10:35 pm

Re: Demand rebalancer/inverse rebalancer

Post by ssilk » Mon Feb 13, 2017 6:50 am

Another good reason for belt/lane balancers is to avoid that ore-fields are mined "unsymmetrical". Left miners are earlier exhausted than right. For example.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Post Reply

Return to “Mechanical Throughput Magic (circuit-free)”