Page 1 of 1

1 or 2-to-6 train loading balancer

Posted: Tue May 30, 2017 11:29 pm
by SpeedDaemon
I needed a 1 (or 2) to 6 balancer for loading trains, which means it couldn't be more than 7 tiles wide. I looked around and wasn't able to find anything like that, so I made one.

Uses an unfortunate amount of "vertical" space, but I can't see any obvious way to make it any smaller.

Image
Blueprint

Re: 1 or 2-to-6 train loading balancer

Posted: Wed May 31, 2017 3:13 am
by AndrewIRL
Your loader looks quite good, similar to:
Image

But Madzuri came up with a circuit build which is much more compact:
https://www.youtube.com/watch?v=4IjfnOSHZ1A

Re: 1 or 2-to-6 train loading balancer

Posted: Wed May 31, 2017 5:15 pm
by Shokubai
That's a decent layout. I've recently settled on a circuit based loading system. It's simple 1 belt in and the circuit balances the chests by average fill. It's clean and requires very little space.
http://imgur.com/wheyAuL

Re: 1 or 2-to-6 train loading balancer

Posted: Wed May 31, 2017 5:41 pm
by Distelzombie
Shokubai wrote:That's a decent layout. I've recently settled on a circuit based loading system. It's simple 1 belt in and the circuit balances the chests by average fill. It's clean and requires very little space.
http://imgur.com/wheyAuL
How does this work?

Re: 1 or 2-to-6 train loading balancer

Posted: Wed May 31, 2017 6:07 pm
by Shokubai
In short terms. It takes the Average amount of an item in all chests. If a chest is less than average it loads...It has some fail-safe so it cant get stuck at some weird (not full) number. It will eat 1.5 blue belts per 6 inserters and load every chest equally.

Re: 1 or 2-to-6 train loading balancer

Posted: Wed May 31, 2017 8:11 pm
by blizgerg
The simplest circuit based balanced loader/unloader that I know of is to wire up all the chests together and input it to an arithmetic combinator set to divide by negative the number of chests. The way things are wired is just like the picture above. red wire connecting all the chests to the input of combinator, red wire connecting all the inserters to the output of combinator, green wire between each chest and inserter that is accessing it. Then you set the inserters that either load or unload to activate on anything > 0 or < 0 depending on if they are loading or unloading. This by it self will get stuck if contents of all chests is an exact multiple of the number of chests. So you add a constant combinator to the output of the arithmetic combinator that adds one or minuses one to the type of item you are loading/unloading.

Total additional parts over no circuit, 1 arithmetic combinator, 1 constant combinator, and lots of wire (wire free if using a blueprint)

anyone know of a simpler that can't get stuck?

Re: 1 or 2-to-6 train loading balancer

Posted: Wed May 31, 2017 9:39 pm
by iceman_1212
Distelzombie wrote:
Shokubai wrote:That's a decent layout. I've recently settled on a circuit based loading system. It's simple 1 belt in and the circuit balances the chests by average fill. It's clean and requires very little space.
http://imgur.com/wheyAuL
How does this work?
We can load evenly across any number of chests with with 1 arithmetic combinator. Here's an example of loading evenly into 24 chests. The benefit is that it's faster to load X items into a train if those items are distributed among multiple chests (as opposed to all X items in one chest). I have played around with circuit-balanced unloading but have found that it is unnecessary (for my bases, atleast) as long as I place one standard balancer downstream to ensure that items are pulled from all wagons.

Image

Close-up of wiring:

Image
Blueprint String

Re: 1 or 2-to-6 train loading balancer

Posted: Wed May 31, 2017 10:50 pm
by Shokubai
The one cimbinator method clogged for me randomly.

Re: 1 or 2-to-6 train loading balancer

Posted: Wed May 31, 2017 10:54 pm
by Distelzombie
BLUEPRIIIIIIIIIIINTSSSS AAAH :D

Re: 1 or 2-to-6 train loading balancer

Posted: Wed May 31, 2017 11:06 pm
by iceman_1212
Distelzombie wrote:BLUEPRIIIIIIIIIIINTSSSS AAAH :D

Added to my last post, my bad :P
Shokubai wrote:The one cimbinator method clogged for me randomly.
Thanks, will keep an eye out for this behavior with my existing ones. I think changing the setting on inserter to <=1 in 0.15 (from <1) should prevent it from happening.

Re: 1 or 2-to-6 train loading balancer

Posted: Thu Jun 01, 2017 2:02 pm
by torne
If you divide by -N and then each inserter is active on <1, then it should be impossible for it to get stuck: this would imply that every chest has more than the rounded-down average number of items, which is impossible (they can't all be above average). If you use <0 then it will get stuck when the chests are all holding very close to the same amount (and also won't start at all when the chests are all empty).

Re: 1 or 2-to-6 train loading balancer

Posted: Thu Jun 01, 2017 2:28 pm
by blizgerg
Ooooo!! So I can remove the constant combinator (to keep it from getting stuck when with a multiple of the number of chests) by changing the <0 or >0 with <1 or >-1 !!!! Excellent!

Re: 1 or 2-to-6 train loading balancer

Posted: Thu Jun 01, 2017 2:32 pm
by Shokubai
torne wrote:If you divide by -N and then each inserter is active on <1, then it should be impossible for it to get stuck: this would imply that every chest has more than the rounded-down average number of items, which is impossible (they can't all be above average). If you use <0 then it will get stuck when the chests are all holding very close to the same amount (and also won't start at all when the chests are all empty).
This is possibly the reason mine stuck back then. Maybe I'll play with that again. I remember it would get stuck close to 1k in each chest.

Thinking this through
24 chests all with 800 ore going to give me a negative average off -800. 800 in the chest -800 is going to give me 0...would be stuck if <0 but not <1. Yay math.

Re: 1 or 2-to-6 train loading balancer

Posted: Fri Jun 02, 2017 5:29 pm
by SpeedDaemon
I use the circuit-based balancer sometimes myself, but there are a few gotchas. The inserters actually need to be enabled on "< max-stack-size" to prevent issues.
You can also run into problems if your trains arrive not-completely-empty, or any other external influence causes the chests to become wildly un-balanced.

Since this was going to go into a hybrid belt/bot ore transfer and distribution station that needs to sustain close to 32-express-belt throughput, I didn't want throughput dropping if bots came and added/removed ore to one chest or another.