Balanced Warehousing Station (un)loading
Posted: Sun Feb 28, 2016 2:30 pm
I use the warehousing mod to get huge (6x6) storage areas which are ideal for station (un)loading since you don't have to mess with splitters, etc. Also, it looks cool.
However, I use multiple wagons (two, in this case) and it tickles my OCD if the warhouse stocks are not in balance (e.g. front warehouse has more stone than rear warehouse.
These is a "balance chest" mod that automatically balances neighbouring chests, so I figured I would create a "balance warehouse".
A trivial solution would be to have a smart inserter moving from A to B if the stock in A > B (and vice versa), but that would cause endless moving of goods when the balance is close. So, we want to move if A is at least (e.g.) 100 more than B.
The left arithmetic combinator adds 100 to the stone signal of the left warehouse, and stores it as "A". The left decider compares "A" to the stone signal from the right warehouse, so emits "A=1" if the left warehouse is understocked by at least 100.
The right combinators do the same but inversed, and use the B signal.
The A and B signal are both moved via the pole to the 2x3 smart inserters, which move the goods to the left if A>0, and to the right if B>0.
This works (as far as I can see), which ensures that trains are loaded evenly, that waiting until empty makes sense, and that I can take from a single warehouse e.g. to smelt bricks or make landfills, without upsetting the balance.
Can this design be simplified?
(edit: I guess now that we have a balancer I might as wel remove the splitter / loop, and just run the belt past both warehouses. Also, apologies to my avatar for decapitating him)
However, I use multiple wagons (two, in this case) and it tickles my OCD if the warhouse stocks are not in balance (e.g. front warehouse has more stone than rear warehouse.
These is a "balance chest" mod that automatically balances neighbouring chests, so I figured I would create a "balance warehouse".
A trivial solution would be to have a smart inserter moving from A to B if the stock in A > B (and vice versa), but that would cause endless moving of goods when the balance is close. So, we want to move if A is at least (e.g.) 100 more than B.
The left arithmetic combinator adds 100 to the stone signal of the left warehouse, and stores it as "A". The left decider compares "A" to the stone signal from the right warehouse, so emits "A=1" if the left warehouse is understocked by at least 100.
The right combinators do the same but inversed, and use the B signal.
The A and B signal are both moved via the pole to the 2x3 smart inserters, which move the goods to the left if A>0, and to the right if B>0.
This works (as far as I can see), which ensures that trains are loaded evenly, that waiting until empty makes sense, and that I can take from a single warehouse e.g. to smelt bricks or make landfills, without upsetting the balance.
Can this design be simplified?
(edit: I guess now that we have a balancer I might as wel remove the splitter / loop, and just run the belt past both warehouses. Also, apologies to my avatar for decapitating him)