Outpost Buffer Chest Balancing

Post all other topics which do not belong to any other category.
Post Reply
Terukio
Long Handed Inserter
Long Handed Inserter
Posts: 67
Joined: Mon Mar 21, 2016 11:30 pm
Contact:

Outpost Buffer Chest Balancing

Post by Terukio »

Hello all,

I'm trying to balance my buffer chests at an ore outpost. There are 6 buffer chests to go into the train and one inserter per chest.

I want to enable/disable inserters based on the amount of ore in the other relative chests so that each chest will have 40 ore, then each have 50, then 60, etc. As opposed to the first having 100, second 80 third 60 etc.

The purpose of doing this is to ensure the train gets loaded as fast as possible, using all 6 inserters into the wagon instead of just 3 because the first 3 chests are the only ones with ore.

I want to mention that my goal is to use the circuit network instead of fancy splitter designs. Compact and quickly blueprintable/repeat able is the goal.

I was thinking of diving the total ore by 6 and looking at the remainder to determine which inserter to activate but obviously that has many flaws especially due to inserter size bonuses.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Outpost Buffer Chest Balancing

Post by DaveMcW »

Terukio wrote:I was thinking of diving the total ore by 6
Close. The solution is dividing the total ore by -6, and setting inserters to operate when less than 1. Each inserter is wired to a chest and the arithmetic combinator using different color wires.

SirLANsalot
Inserter
Inserter
Posts: 41
Joined: Sat Mar 12, 2016 8:38 pm
Contact:

Re: Outpost Buffer Chest Balancing

Post by SirLANsalot »

you can click on the red X while looking into a box, and "block out" parts of the chest you don't want to have them load into. Aka instead of having the chest fill till its full, you can tell it to load up only one row before the game thinks its "full" and the inserter stops, thus allowing the others down the line to start filling up.

I myself have been working on solutions like this too, and just splitting the ore up 6 times with a splitter is ONE way to solve the issue, at least then each box WILL be getting some ore, even if 2 of them are slightly un-balanced and get a little more then the others.

With vanilla wagons, they fill quite quickly already, its the modded ones (like from Bob's Logistics) that things can take quite a while to load/unload (those MK3 wagons are BIG CAP!).

golfmiketango
Filter Inserter
Filter Inserter
Posts: 549
Joined: Fri Jan 29, 2016 2:48 am
Contact:

Re: Outpost Buffer Chest Balancing

Post by golfmiketango »

DaveMcW is talking about this:

Image

It's a brilliant design and it does work. Note that the "1" on the right would ideally be replaced by the stack-size bonus that your inserters are currently operating with. Also, if you think about how this works, if all the chests perfectly equalize, it will deadlock. In practice this is rare and not permanent as the next train would fix it. But it's not fantastic either. Not sure what the best way to deal with that is -- maybe put a more liberal condition on the far-right inserter or whichever is at the end of the belt (i.e., <23 or something like that)?

If you are setting it up by hand for a big train it's quite a fussy undertaking I'm afraid. You really want a personal roboport to set this up at outposts.

Personally I don't buffer like this anymore; I just go from miners to belts to the train-car, but that's another story. Similar designs to this can do all kinds of stuff; an [/ -X] arithmetic combinator is a reasonable starting point any time you want to slice up resource inputs equally between a number of circuit-connectable outputs.

Terukio
Long Handed Inserter
Long Handed Inserter
Posts: 67
Joined: Mon Mar 21, 2016 11:30 pm
Contact:

Re: Outpost Buffer Chest Balancing

Post by Terukio »

Thank you all, I will try this out later tonight.

As for the deadlock, would having a chest off to the side with a single item in it and wire that to the green circuit pictured above remove any chance of deadlock as they all would never be perfectly balanced at that point?

Edit: thinking back on that when the mine runs dry this could pose a problem. Perhaps just have the last inserter not be controlled by the red circuit and let it have free roam. Since it will (probably) only grab if a few inserters before it had been disabled.

rolfl
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Thu Jun 16, 2016 6:21 pm
Contact:

Re: Outpost Buffer Chest Balancing

Post by rolfl »

Terukio wrote: As for the deadlock, would having a chest off to the side with a single item in it and wire that to the green circuit pictured above remove any chance of deadlock as they all would never be perfectly balanced at that point?
A constant combinator outputting the correct signal is what I have used to resolve the deadlock, but set it to the number of chests, not to 1. So, in your case, a constant combinator with 6-ore output will make even a completely empty system be "less than average", and operate OK.

SirLANsalot
Inserter
Inserter
Posts: 41
Joined: Sat Mar 12, 2016 8:38 pm
Contact:

Re: Outpost Buffer Chest Balancing

Post by SirLANsalot »

so those are some nice, very complex setups....but this is how I solved the issue in a much more simplistic manner LOL.

I just used splitters to even it all out so here is the example of what I did. I have a faster belt going from the miners before it hits the spread to the train car. I have bobs mod running so blues here are slower then the purples that feed from the miners into the splitters. But even in vanilla you would want blues leading into reds. Doing that keeps the main belt at full sat while all the chests evenly get ore.
Image

Here is the unload in the main base, 6 cars with 6 chests each, so I have the splitter setup reversed to combine it all into one. Which then feeds into ANOTHER set feeding into a mainline to the furnaces.

Image

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Outpost Buffer Chest Balancing

Post by Deadly-Bagel »

golfmiketango wrote:Also, if you think about how this works, if all the chests perfectly equalize, it will deadlock.
No it won't? If you have 10 ore in 6 chests:

60 / -6 = -10

So each inserter will see a signal of 0 ore, which meets the condition [ore] < 1 and they will all activate.
SirLANsalot wrote:I just used splitters to even it all out so here is the example of what I did.
This isn't balancing, the middle two chests will receive 1/4 of the feed each, the other four chests will receive 1/8 each. I think if you took this design, doubled and inverted it you will have a balanced system.

EDIT: Normally this wouldn't be a big deal but you've used the same splitter to split between wagons so your middle two wagons will always get a bigger share.
Money might be the root of all evil, but ignorance is the heart.

SirLANsalot
Inserter
Inserter
Posts: 41
Joined: Sat Mar 12, 2016 8:38 pm
Contact:

Re: Outpost Buffer Chest Balancing

Post by SirLANsalot »

Deadly-Bagel wrote:
SirLANsalot wrote:I just used splitters to even it all out so here is the example of what I did.
This isn't balancing, the middle two chests will receive 1/4 of the feed each, the other four chests will receive 1/8 each. I think if you took this design, doubled and inverted it you will have a balanced system.

EDIT: Normally this wouldn't be a big deal but you've used the same splitter to split between wagons so your middle two wagons will always get a bigger share.
Its not perfect, but it does work very well rather then a single belt coming across and having to mess with the wire system. There are still ways to improve it but when combining back down to 1 lane it works nearly perfectly (belts hit full saturation nearly instantly).

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Outpost Buffer Chest Balancing

Post by Deadly-Bagel »

Oops, yeah that's unloading but point still stands. The middle two carriages will unload twice as fast as the other four but as throughput clearly isn't a priority as you've got six carriages unloading to a single belt, I guess it's not a big deal for that particular circumstance (which happens to be the opposite of the query in this topic lol).
Money might be the root of all evil, but ignorance is the heart.

Quax
Long Handed Inserter
Long Handed Inserter
Posts: 97
Joined: Mon Mar 14, 2016 7:57 am
Contact:

Re: Outpost Buffer Chest Balancing

Post by Quax »

Deadly-Bagel wrote:
golfmiketango wrote:Also, if you think about how this works, if all the chests perfectly equalize, it will deadlock.
No it won't? If you have 10 ore in 6 chests:

60 / -6 = -10

So each inserter will see a signal of 0 ore, which meets the condition [ore] < 1 and they will all activate.
SirLANsalot wrote:I just used splitters to even it all out so here is the example of what I did.
This isn't balancing, the middle two chests will receive 1/4 of the feed each, the other four chests will receive 1/8 each. I think if you took this design, doubled and inverted it you will have a balanced system.

EDIT: Normally this wouldn't be a big deal but you've used the same splitter to split between wagons so your middle two wagons will always get a bigger share.
I'm far from using combinators and logic circuits right now, however I'm curious how this is working: the inserter is set to operte only when receiving a count <1. But how can the count become larger then 1? Dividing by -6 always gives a number below 1, regardless of the amount of ore in the chests? At max it's Zero (when no ore is in the chests: 0/-6 = 0). So - the inserters are operating all the time?? Isn't this just like doing no combinator logic at all?

I know I must be missing the obvious here .... so if you can point it out :-)

Terukio
Long Handed Inserter
Long Handed Inserter
Posts: 67
Joined: Mon Mar 21, 2016 11:30 pm
Contact:

Re: Outpost Buffer Chest Balancing

Post by Terukio »

Quax wrote:Dividing by -6 always gives a number below 1
You're correct on that front, but by using a second circuit connecting the inserter to it's respective chest the ores in the chest will add to the negative value coming from the arithmetic combinator resulting in a number close to zero depending on the number of ore in that chest. If that chest has more than the average it outputs a number greater than 1 to the inserter while a value less than the average results in a negative value. A number equal to the average results in zero...

Which leads me back to Deadly-Bagels comment:
Deadly-Bagel wrote:No it won't? If you have 10 ore in 6 chests:

60 / -6 = -10

So each inserter will see a signal of 0 ore, which meets the condition [ore] < 1 and they will all activate.
Why would it deadlock like originally stated, golfmiketango?

I noticed it did at times without the cominator outputting a signal of 6 ore. Why could this be?

-------------------------

In response to sirLANsalot,

Those splitter designs go against what I had originally talked about in the OP strictly because of the large footprint required and the excess amount of materials used to do what a few circuit wires and combinators can do.

Also no to mention the ore input to the train would have an uneven distribution of 12.5% 12.5% 25% 25% 12.5% 12.5%. Yes this would result in the train still becoming full, no it will not fill the train as quick as possible if the outside chests run out of ore before the middle chests which can occur as the outpost reaches the middle/end of it's life.

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Outpost Buffer Chest Balancing

Post by Deadly-Bagel »

Yes, the signal outputs -10 ore but then you connect the chest (using the other colour wire) to its respective inserter ONLY so the two signals get added together.

-10 (from circuit) + 10 (from chest) = 0

When the chests are uneven, say one chest has 15 (but the rest make the average exactly 10):

-10 + 15 = 5

Thus the inserter for this chest will stop working.

Set up correctly, this system will never deadlock, it's not possible. Check you are dividing by the negative of the number of chests you have, and that all your wires are hooked up correctly. Check the contents of the chests and the input of the combinator to ensure they match up.
Money might be the root of all evil, but ignorance is the heart.

Quax
Long Handed Inserter
Long Handed Inserter
Posts: 97
Joined: Mon Mar 14, 2016 7:57 am
Contact:

Re: Outpost Buffer Chest Balancing

Post by Quax »

Great game. Even greater community :-)

Thanks for my first combinator lesson :-)

Post Reply

Return to “General discussion”