Any simple & cheap way to isolate a chest read signal?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
blazespinnaker
Filter Inserter
Filter Inserter
Posts: 665
Joined: Wed Sep 16, 2020 12:45 pm
Contact:

Any simple & cheap way to isolate a chest read signal?

Post by blazespinnaker »

I'd like to use the read contents of a chest to make a decision based on the collective total content of other chests

eg: disable inserter if it's chest contents it's pulling from is below the average of all the other chests, in some (perhaps very lame) attempt to balance train offloading. But I can't see a simple and cheap way to do this as the signal from the chest gets conflated with the other signals. eg, iron ore signal on the network always seems to be the total of all the chests. this is useful for finding the average, but not so useful for making a decision for a single inserter.

Another approach I was going to try was disabling the inserter if it's chest contents is above the contents of the first insert (the one at the far right). Not sure either approach will work but I was wondering if there was a simple way to balance without using multiple combinators.

Any thoughts from combinator experts out there?

Here is a picture of my avatar looking stumped.
Attachments
Screenshot 2021-01-15 163103.png
Screenshot 2021-01-15 163103.png (1.06 MiB) Viewed 4133 times
Last edited by blazespinnaker on Sat Jan 16, 2021 12:35 am, edited 1 time in total.
OptimaUPS Mod, pm for info.

Trific
Fast Inserter
Fast Inserter
Posts: 147
Joined: Thu Dec 31, 2020 7:57 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by Trific »

Use an arithmetic combinator to compute the average, and send that out on a different channel. Use one color wire to connect to all the chests to get the total, and the other color wire to connect each chest to its inserter.

blazespinnaker
Filter Inserter
Filter Inserter
Posts: 665
Joined: Wed Sep 16, 2020 12:45 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by blazespinnaker »

Trific wrote:
Sat Jan 16, 2021 12:34 am
Use an arithmetic combinator to compute the average, and send that out on a different channel. Use one color wire to connect to all the chests to get the total, and the other color wire to connect each chest to its inserter.
ohhhh right. Doh. I should have known that. Not enough time is my excuse, but really I am just lazy.

Thank you very much sir. Sorry for the silly question, folks. I'd delete the thread if I could.

edit: hmm, no, that doesn't seem to work or maybe there is some implicit way I'm missing. There doesn't seem to be a way to select the signal coming from a specific color wire / channel in the enable condition. They are both outputting iron ore, though one signal is reddish and the other is greenish.

The problem is that the arithmetic combinator is sending along the ore signal as well as the computed average.

I'll play around with it a bit more. Perhaps there is something about the order in which I do it. Maybe I'll read the wiki. That feels like cheating tho.
OptimaUPS Mod, pm for info.

Trific
Fast Inserter
Fast Inserter
Posts: 147
Joined: Thu Dec 31, 2020 7:57 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by Trific »

Output the average as a different signal (red, green, a letter, whatever). Then enable the inserter if (for instance) the letter A signal (from the combinator) is greater than or less than the ore signal (from the chest).

To be really specific. Use red wire to wire from each chest to the next and then to the input of the arithmetic combinator. Set the combinator to compute "ore" divided by the number of chests, and output the result on the "A" channel. Use red wire to then wire from the output of the combinator to the inserters. Use green wire to wire each inserter to its chest to keep the signals separate. The red wires to the chests and the red wires to the inserters should form separate networks (check the network number), and the green wires between the chests and the inserters should also be separate networks (one network per each chest/inserter combo. Set the inserter to enable on "A" < "ore".

astroshak
Filter Inserter
Filter Inserter
Posts: 597
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by astroshak »

This is known, as far as I know, after the guy who came up with it : MadZuri.

You usually want to use the >= or <= setting on the Inserters, not just < or >, because if they are all exactly the same, at the average, then they won’t operate.

blazespinnaker
Filter Inserter
Filter Inserter
Posts: 665
Joined: Wed Sep 16, 2020 12:45 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by blazespinnaker »

Yeah, looks like it's described on the wiki. the trick appears to be comparing against the logistics signal to compare < 1 And divide by negative # of chests. Neat.

https://wiki.factorio.com/Tutorial:Combinator_tutorial
OptimaUPS Mod, pm for info.

blazespinnaker
Filter Inserter
Filter Inserter
Posts: 665
Joined: Wed Sep 16, 2020 12:45 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by blazespinnaker »

Trific wrote:
Sat Jan 16, 2021 1:29 am
Output the average as a different signal (red, green, a letter, whatever). Then enable the inserter if (for instance) the letter A signal (from the combinator) is greater than or less than the ore signal (from the chest).

To be really specific. Use red wire to wire from each chest to the next and then to the input of the arithmetic combinator. Set the combinator to compute "ore" divided by the number of chests, and output the result on the "A" channel. Use red wire to then wire from the output of the combinator to the inserters. Use green wire to wire each inserter to its chest to keep the signals separate. The red wires to the chests and the red wires to the inserters should form separate networks (check the network number), and the green wires between the chests and the inserters should also be separate networks (one network per each chest/inserter combo. Set the inserter to enable on "A" < "ore".
Yes, this is what I did exactly when you first mentioned it. The problem is that Ore was being sent as a signal to the inserter alongside the A signal on the same network as the red wires. However, after scrapping and redoing everything, the Ore signal is no longer being sent on the red wire. Perhaps I had an errant wire connected somewhere. It now works, really well in fact.

Thanks for your patience, Trific.

Fwiw, I wasn't able to get madzuo's approach to work. But, I wouldn't take that as authoritative given my track record here.
Attachments
Screenshot 2021-01-15 202442.png
Screenshot 2021-01-15 202442.png (657.95 KiB) Viewed 4062 times
OptimaUPS Mod, pm for info.

Trific
Fast Inserter
Fast Inserter
Posts: 147
Joined: Thu Dec 31, 2020 7:57 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by Trific »

LOL at that wiring. My networks certainly got a lot neater once I realized that what was connected to what didn't matter if they were in the same network. 90% is defining network isolation boundaries and deciding what each signal inside each network will represent. 10% is remembering that if you bring two networks together on the same input, that implicit add will bite you if you didn't want them added.

blazespinnaker
Filter Inserter
Filter Inserter
Posts: 665
Joined: Wed Sep 16, 2020 12:45 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by blazespinnaker »

Ah, feedback appreciated. I wonder if there is an underground electric line mod.
Attachments
Screenshot 2021-01-15 231630.png
Screenshot 2021-01-15 231630.png (455.24 KiB) Viewed 4004 times
OptimaUPS Mod, pm for info.

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by disentius »

Here is the "original" MadZuri loader, with a stacksize tweak I found to help with throughput. (counters not included in blueprint. (Magic lamp)

MadZuri loader.gif
MadZuri loader.gif (18.83 MiB) Viewed 3957 times

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by steinio »

disentius wrote:
Sat Jan 16, 2021 10:59 am
Here is the "original" MadZuri loader, with a stacksize tweak I found to help with throughput. (counters not included in blueprint. (Magic lamp)


MadZuri loader.gif
The lamp signs look neat and way better as the smart displays.

To what value exactly did you tweak the stack size?
Image

Transport Belt Repair Man

View unread Posts

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by disentius »

i found this combo to be able to almost consume a blue belt per wagon.
2021-01-16 13_29_10-Window.png
2021-01-16 13_29_10-Window.png (43.28 KiB) Viewed 3920 times

blazespinnaker
Filter Inserter
Filter Inserter
Posts: 665
Joined: Wed Sep 16, 2020 12:45 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by blazespinnaker »

I ended up removing it, sadly, as it behaved poorly under impaired load. Fun experiment though. Will try some others.

I am not particularly optimistic, but very hopeful there is a cool, simple and effective way to balance loading / unloading. Thanks to all that chimed in.
OptimaUPS Mod, pm for info.

gGeorg
Filter Inserter
Filter Inserter
Posts: 392
Joined: Wed Jun 19, 2019 8:06 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by gGeorg »

Instead of 6 iron chests, use one wagon. Place it on independent piece of track, it balances itself.
:idea:

starlinvf
Fast Inserter
Fast Inserter
Posts: 145
Joined: Sat Dec 14, 2019 6:28 pm
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by starlinvf »

gGeorg wrote:
Sat Jan 30, 2021 2:23 pm
Instead of 6 iron chests, use one wagon. Place it on independent piece of track, it balances itself.
:idea:
But aren't tracks doubled-tiles on the grid? Wouldn't be able to line up the inserters correctly to move items across.

User avatar
NotRexButCaesar
Smart Inserter
Smart Inserter
Posts: 1121
Joined: Sun Feb 16, 2020 12:47 am
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by NotRexButCaesar »

starlinvf wrote:
Sat Jan 30, 2021 2:46 pm
gGeorg wrote:
Sat Jan 30, 2021 2:23 pm
Instead of 6 iron chests, use one wagon. Place it on independent piece of track, it balances itself.
:idea:
But aren't tracks doubled-tiles on the grid? Wouldn't be able to line up the inserters correctly to move items across.
Place cars or tanks maybe?
—Crevez, chiens, si vous n'étes pas contents!

astroshak
Filter Inserter
Filter Inserter
Posts: 597
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: Any simple & cheap way to isolate a chest read signal?

Post by astroshak »

blazespinnaker wrote:
Sat Jan 16, 2021 9:19 pm
I ended up removing it, sadly, as it behaved poorly under impaired load. Fun experiment though. Will try some others.

I am not particularly optimistic, but very hopeful there is a cool, simple and effective way to balance loading / unloading. Thanks to all that chimed in.
I use a belt balancer before a loading station, and a belt balancer after an unload station. I do not attempt to balance the chests feeding any one cargo wagon; I rely on the belt balancer to balance the material going to each cargo wagon only.

If I’ve got 6 belts of ore coming from a mine, and I’m using 8 cargo wagon long trains, I’ll use a pair of 8x8 balancers in an attempt to make the entire contraption a universal balancer (does not matter how many inputs are starved, or outputs are blocked, all incoming material is split evenly among all available outputs). I have not done the math to see how accurate it is, but just eyeballing it seems to work well.

My thought process is this. If I’m getting each cargo wagon the same amount of material, then I’m not speeding one wagon filling at the expense of another taking a longer time to fill. If I’ve got one belt for two wagons, I’d rather fill both wagons with half a belt, than fill one with a full belt and then fill the other. For the offload, I’d rather make sure that all the wagons get unloaded so long as at least one output belt is not backed up.

This also allows me to use a single Arithmetic Combinator to set the Train Limit at stations. I simply wire all of the loading chests together, to the input of the Arithmetic Combinator. Each / (capacity of train), output Each. A 2 cargo wagon train carrying green circuits would be Each / 8000, output Each, for example. Train stop is Enabled when the item (Iron Ore, Green Circuits, etc.) > 0, and the Train Limit is set to that same signal. This technique is good for any single cargo (IE - not a mixed cargo) moved in bulk. I use it for ores a lot.

No, I’m not ensuring that the 6 chests loading the cargo wagon are evenly loaded. I don’t really see much of a point in doing that. I care more about the cargo wagon than the chests feeding it, or fed from it. If nothing else, then I hope this encourages you to think outside the box.

Post Reply

Return to “Gameplay Help”