Circuit filtering for wagons "spilling", how to fix?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Frenzier
Inserter
Inserter
Posts: 28
Joined: Mon Aug 13, 2018 1:15 pm
Contact:

Circuit filtering for wagons "spilling", how to fix?

Post by Frenzier »

I have it so the loaders only activate when a specific train ID is present, the same happens with inserters so its not related to loaders, When a train finishes loading and moves out, the new train that arrives that its supposed to receive a different resource gets a tiny spill(1-2) of the resources meant for the previous train, how can i prevent this? Is this a bug? In the image you can see 2 iron ore was loaded as they arrived at the station but only slag its meant to be loaded. Image
Last edited by Frenzier on Thu Apr 11, 2019 1:49 pm, edited 1 time in total.

Frenzier
Inserter
Inserter
Posts: 28
Joined: Mon Aug 13, 2018 1:15 pm
Contact:

Re: Circuit filtering for wagons "spilling", how to fix?

Post by Frenzier »

I have been given the solution of filtering the inventory of the wagons, like i filter the quickbar, it works, but only because im using a different entity for each resource, if i used the same entity for different resources it would not work.

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

Re: Circuit filtering for wagons "spilling", how to fix?

Post by astroshak »

Set the inserters stack size. 1 if feeding from belts. 10 if using stack inserters and feeding from a box.

Might also try to set filters so that it doesn’t want to load more than the cargo wagon can hold of that item. Its when the inserters has more than will fit that it is left handing, and deposits the extra into the next train.

That works for inserters. I don’t know how to do it with loaders or miniloaders.

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Circuit filtering for wagons "spilling", how to fix?

Post by Koub »

|Koub] Moved to Gameplay Help
Koub - Please consider English is not my native language.

GrumpyJoe
Filter Inserter
Filter Inserter
Posts: 443
Joined: Fri Apr 06, 2018 7:10 pm
Contact:

Re: Circuit filtering for wagons "spilling", how to fix?

Post by GrumpyJoe »

Ever played with LTN? That would help a little, because its actually quite common to have mixed warehouses and thinking of it, using train ID is somewhat simillar to reading train schedules with LTN stop´s output combinator.
Actually a brilliant idea

Wall of text incoming, but i like to take the problem apart into smaller steps
If you like a TLDR, skip to the last line and have it build for you :P


What went wrong?

In your case, inserters kept some items in their hands because the last iron train was full. That iron gets dropped into the stone train, even if they are disabled
As already said, filtered wagon slots is the easiest way in your case.


But the loading time could be improved alot, with the side effect of not spilling items, at the tiny cost of not fully loaded wagons.

Prevent inserters from keeping items in their hands


A (vanilla) wagon has 40 slots, with something like stone (stack size 50) thats 2000 stone.
You have to read train contents and stop loading when it reaches 1950 (depending on inserter stack size, but one is usually enough with inserters), times the number of wagons.
That way, you will have like 1970 items loaded, because inserters continue to unload into the last slot.
That one slot will not get loaded fully.
The next train will not get those leftovers that you have now.


Filtered loading of chests providing multiple items


Usually i use filter stack inserters, with Bobs, they are fast enough.
But I have tried it with miniloaders. Since they can hold more than one inserter and you actually need two of them in line, you need to stop at least 2 stacks before a full load is reached. Thats because you have 6 loaders per wagon * 2 tiles with loaders. I believe miniloaders have like 4 or 6 invisble inserters inside. You could have like 50 items or more in transit between your chest and the wagon.
However, with loaders it needs some testing whats left in the loaders after you stop letting them.
Gets worse with barrels. Dont try that.

That was only the theory

Lets move on to implementing that


What you do is
Set filters dynamicly according to train ID, making loading alot faster than your current setup
Which, as I understand it, has one filtered loader per wagon and item type active, depending on the train ID, the rest is disabled.

Example
IF T = 917 (example for train ID);Output "item"
The amount is (item stack size * wagons * (wagon slot number -1)) which you set manually in a constant combinator before your deciders. You can combine all items on all inputs, since you only let one through anyway.
Connect those outputs of deciders to the output of an arithemtic that inverts (anything * -1) anything coming from the train stop, which needs to be set to "read train contents" as well as your "read train id"

Setup:
Chest->filter loader->normal loader->wagon
Filter loader is set to "set filter" (not enable), all filter loaders are connected together to the deciders

-Train sends ID, filter is set, filtered miniloader loads into a normal miniloader, that empties into the wagon
-Train is "full", filter signal is "removed". *)
-Normal miniloader still loads what it last got from the filter loader
-Wagon gets what was left from previous 2 steps

You need to set leave condition to "inactive", not "full" or "item count"

hope that helps

* why no filter is set any longer, a FYI

Negative signals will not work as "set filter" condition
If the combined signal gets negative, because the wagon has more than we want (1950 demand - 1970 wagon load = -20 in the above example), the filter is "removed" and the loading is stopped
Also "set filter" controlled inserters that dont get a signal thats a movable item will stop working (you could have any other signal like [A] or [1] present. Which is handy, since you will have the train ID on that cable too.
That one actually doesn´t matter, since its negative because of the inverter ;)

If you´d post a BP, i could change it according to what i suggested, but i think i´ll need a link to the chest enlarger mod that you seem to use, not sure there´s only one.

Frenzier
Inserter
Inserter
Posts: 28
Joined: Mon Aug 13, 2018 1:15 pm
Contact:

Re: Circuit filtering for wagons "spilling", how to fix?

Post by Frenzier »

GrumpyJoe wrote:
Thu Apr 11, 2019 7:20 am
I figured it was possible to do a more complex circuitry to make it load more efficiently, but i only understand how to do very basic circuits for now. The chest mod https://mods.factorio.com/mod/WideChests, you dont really need to download it since the way it works is you put down a row of chests then use a tool to highlight them and they merge into 1, so a blueprint with no chests would work, since from what i understand you dont need to wire the chests.

I have never used LTN, well i tried but could not figure out how to make it work, currently im using TSM, it serves a similar purpose and its simpler to use.

If you can give me an example blueprint of what you suggest i would appreciate since i dont understand a lot of what you just talked about, from what i understood you can tie specific filter settings to train ID, allowing for more efficient loading, since you can get the full row of loaders to work, but i have no idea how to do the circuitry for that, also how to get the loaders to only load a specific amount, in order to prevents leftovers in the loaders.

In this blueprint im using 2 different kinds of loaders, miniloaders, which are the ones that can load into trains, and deadlocks´s compact loaders, those have filter settings but do not allow circuit connection, so you will need to switch them with filter miniloaders.

The blueprint string

GrumpyJoe
Filter Inserter
Filter Inserter
Posts: 443
Joined: Fri Apr 06, 2018 7:10 pm
Contact:

Re: Circuit filtering for wagons "spilling", how to fix?

Post by GrumpyJoe »

Frenzier wrote:
Thu Apr 11, 2019 1:44 pm
You are right, sadly its impossible to set filters via wires or load trains with deadlocks. DL loaders are so convenient!


Its not really much more complex, my BP uses 1 extra Constant combinator and one 2 extra arithemtic combinators, everything else is almost the same, just uses some simple tricks
Im not sure if this can be minimized with less deciders, i have not put much thought into that.


Below you can see that i didn´t change the T= part (my loco for testing purpose is 10. You can ignore that, the BP will have it set back to your copper train ID)
I only changed the output to "item X"; and also to "input count"
That sends the item signal through the combinator that gets activated by the correct train ID

The constant combinator is set to 30000k of each "item X". The exact number of desired wagon slots (160 - 4 = 154) * item stack size (200) would be 31200. Or 32000-4 stacks.
Im not sure about whats in transit when using miniloaders, and the goal is to empty them all before the train leaves. You can increase it and test at which point items still get stuck to maximise the train load. But the troughput will be increased drasticly anyway, i would leave it for now, until you exactly know whats going on.

The Arithemtic Combinator reads the train stop (which is set to "read train contents" in addition to your "read stopped train", which got you the ID) and inverts both signals by multiplying by -1
Note that its green cable, to not get the signal in contact with the items from the constant combinator, or it would invert them too.

The signal from the "inverter" and the active decider join at the power pole.
There you get a positive value from the decider which sets the filter in the miniloaders. (You also get T= -"train ID", which can be ignored)
As soon as there is cargo in the train, that gets through the green cable to the inverter to the power pole (same color!) and gets substracted from the item signal.
When there is more cargo than items set in the CC, the value gets negative. That "resets" the filter and the filter miniloaders stop working
There are still items in the normal miniloaders which can be loaded, since the train shouldn´t be full yet, instead the final result will be slightly above 30k and no items will be stuck


Make sure there is roughly the same of any item in both chests , or 2 wagons might get full, because the other 2 wagons have nothing in the box to be loaded.
i.e. the signal is 30000, you have 20k in one chest, 10k in the other chest, the first 2 wagons get 16k and will be full, because its trying to load from the 2nd chats, which will be empty.

Full wagons = stuck items, again



Try it and if you have further questions, ping me again ;)
BP1.png
BP1.png (1.8 MiB) Viewed 3448 times
Last edited by GrumpyJoe on Thu Apr 11, 2019 5:05 pm, edited 3 times in total.

GrumpyJoe
Filter Inserter
Filter Inserter
Posts: 443
Joined: Fri Apr 06, 2018 7:10 pm
Contact:

Re: Circuit filtering for wagons "spilling", how to fix?

Post by GrumpyJoe »

Frenzier wrote:
Thu Apr 11, 2019 1:44 pm


FOUND A BUG! :D

Will get the BP updated!

Edit:

So here I am, blabbering about my genius, forgetting a crucial thing

Since the red wire from the station will also carry the train contents, they will get added to the constant combinators signal, essentially making this trying to load nonstop


We need to set a filter, that only lets through the T signal
You can do that in multiple ways:
Arithmetic T * 1 or T + 0; Output T
or Decider T > 0; Output T


I think this can be done with 1 extra, instead of 2, but i rather get it working for now
:roll:
nope, not possible, unless someone else finds a way

This time for real, hopefully
Im sorry, i might have given you a T=10 for copper, forgot to change it this time
It was 2559 before


Pic

Frenzier
Inserter
Inserter
Posts: 28
Joined: Mon Aug 13, 2018 1:15 pm
Contact:

Re: Circuit filtering for wagons "spilling", how to fix?

Post by Frenzier »

I was beginning to understand that circuit and then bam, you made it even more complicated, i will try it tonight when i have time to play. Thanks again.

Edit: I have tested and it seems to be working as intended.
Last edited by Frenzier on Thu Apr 11, 2019 7:12 pm, edited 2 times in total.

GrumpyJoe
Filter Inserter
Filter Inserter
Posts: 443
Joined: Fri Apr 06, 2018 7:10 pm
Contact:

Re: Circuit filtering for wagons "spilling", how to fix?

Post by GrumpyJoe »

Frenzier wrote:
Thu Apr 11, 2019 5:11 pm
I was beginning to understand that circuit and then bam, you made it even more complicated, i will try it tonight when i have time to play. Thanks again.
You´r welcome. Dont worry, in the beginning it was hard to grasp for me as well. I still dont understand some wizardry that get puts out there

Bit shifting? Can you eat that? :D

Its indeed better to look at it ingame, when you got some time.
The extra "filter" is actually the easiest part, it does what it says, only carry one signal (T) and drop the rest

Frenzier
Inserter
Inserter
Posts: 28
Joined: Mon Aug 13, 2018 1:15 pm
Contact:

Re: Circuit filtering for wagons "spilling", how to fix?

Post by Frenzier »

Its not working as well as expected, 30k seem to be to high a value because for some odd reason the wagons are not being filled evenly at the same time by a lot, the difference being in something like 1.5k, so i get a wagon reaching 8k while another one its around 6.5k, that results in leftovers in the loaders that block the loading for the following trains, what i dont understand its why they are not filling evenly...

Edit: I think i have figured out the issue, one of the loaders was for some odd reason stuck with "waiting for space in destination" switching its direction twice seems to have solved it.

GrumpyJoe
Filter Inserter
Filter Inserter
Posts: 443
Joined: Fri Apr 06, 2018 7:10 pm
Contact:

Re: Circuit filtering for wagons "spilling", how to fix?

Post by GrumpyJoe »

well, as i said, you need to balance the chests first to not get that behaviour. (not saying you havn´t, just as a reminder as that could also cause uneven loading and full wagons)
If you have that, good luck with problem solving. :|
having a stuck miniloader wouldn´t have been on my list to check. both these and DL´s can be tricky at times

Its always a trade, playing around with unusal builds, as fewer people will have a solution for your problems (speaking generally, again ,not pointing at you)
But as one loader per item also got stuck, i think thats a trade you can take

Hope you like it and has helped you getting started on more circuit stuff. Again, reading train ID´s wasn´t something i would have tought of.

Post Reply

Return to “Gameplay Help”