Inserter jams when loading cargo wagon

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
becreswell
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Oct 26, 2023 7:18 pm
Contact:

Inserter jams when loading cargo wagon

Post by becreswell »

Inserters will jam when loading a cargo wagon if the wagon has multiple item filters set. If there is a slot with 99 out of 100 iron, the inserter will pick up 2 iron and then jam when 2 iron don't fit. This prevents it from loading the rest of the wagon with other item types. The only way i've found to work around it is to override the stack size and set it to 1, which is obviously not a good way to load trains.

The fix for this bug would be to have the inserter only pick up 1 iron to complete the stack before moving on to pick up steel 2 at a time.
jammed inserter.png
jammed inserter.png (346.19 KiB) Viewed 611 times

mmmPI
Smart Inserter
Smart Inserter
Posts: 2749
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Inserter jams when loading cargo wagon

Post by mmmPI »

becreswell wrote:
Wed Nov 01, 2023 6:11 am
The only way i've found to work around it is to override the stack size and set it to 1, which is obviously not a good way to load trains.
The way you found is going in the right direction though, because if an inserter get stuck with the wrong material, it's already problematic, but it will also cause it to drop that extra item in the next train coming by which is another problem that your solution doesn't cause.

Now what you want is going faster, or use more than 1 inserter i suppose, but then reducing stack size to 1 would not work, because if there is 1 room left for 1 iron plate and 6 inserter grab 1 at the same time, 5 will get stuck.

You could use 2 filter inserters one for steel one for iron plate, that's another way you may want to look for. But beware of cargo wagon without filter in the next train if you have some filter inserter left holding some item :D

It depends what you want to do, or if you were just toying with trains to see how it works, there are others ways , like using circuits networks, in particular, the ability to connect the train stop and the inserters, this allow to "read the content" of the train if you tick that option in the connected-with-wire train station. Inserters can have their stack size set with circuit network. So one another way would be to use arithmetic combinators to turn the train content into negative, so instead of 450 iron plate, the signal would be -450 iron plate if the train has 450 plate in its wagon. 450 input , the operation is multiplication between "each" and "-1" so it will also turn the steel quantity or any quantity into negative. Then if you connect with the same wire color a constant combinator to the output of the arithemtic, it will automatically addition the value in the constant, and the negative value. So if you want 500 plate in the train, you set the constant with "500" in the signal "iron plate". At any point you can read the value in the wires when they are connected to a power pole, if you connect such wire to an inserter, it will read "50 iron plate", and you can use that as stack size when the inserter is connected to a wire, you can tick the option "set stack size" and the signal "iron plate".
When it's above the max stack size allowed, it will choose the max instead, but if you have 497 iron plate, the output of the arithmetic would be -497 +500 in the constant combinator, the result would be 3 so the stack size would be 3. And maybe it will take 3, if 2 is the max, then it will be 499 plate in the train, 500 in the constant, so stack size would automatically change to 1 and it will prevent the inserter to grab too many plate for the last swing.

Yes that only works with 1 inserter but that's also only using 2 combinators, not sure if that is your thing but there are ways to investigate there.

Again depending on what you have in mind, there may be different solutions. Filtering wagons and using filter inserters is quite robust and simple , it prevent 1) wrong material in wagon 2) inserter stuck with wrong material (*most of the time)

*The risk is you have a train you want loaded full iron, and then a train loaded full copper and you plan to change the filter of the inserter in between, but they have already some iron grabbed leftover, so some of them won't load the copper train, but would resume their work once a iron train need to be loaded. As such it's not always a good idea to change filter, it also depend on the larger picture.

robertsonj
Inserter
Inserter
Posts: 22
Joined: Thu May 14, 2020 4:08 am
Contact:

Re: Inserter jams when loading cargo wagon

Post by robertsonj »

I've had this problem while using the LTN mod and I handled it like this.

Most items have stack sizes of 50 or multiples of 50 (eg, 100, 200). If you want to use this technique for smaller stack items, then you need to adjust the limits, but the principle will still work.

I set up 5 inserters loading a wagon, and set the item limit to either 1, 2, 5 or 10. As I researched the inserter upgrades, I increased to the next size in the list.
This means that each inserter swing, the group will load 5, 10, 25 or 50 items. These are all multiples of the stack sizes.

As long as all stations work like this, and wagons are always emptied in the same manner (eg emptied of whole stacks), you can never end up with part stacks in a wagon.

Unfortunately this method won't work once a wagon or inserter becomes "jammed".

mmmPI
Smart Inserter
Smart Inserter
Posts: 2749
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Inserter jams when loading cargo wagon

Post by mmmPI »

robertsonj wrote:
Fri Nov 03, 2023 9:41 am
Most items have stack sizes of 50 or multiples of 50 (eg, 100, 200). If you want to use this technique for smaller stack items, then you need to adjust the limits, but the principle will still work.

I set up 5 inserters loading a wagon, and set the item limit to either 1, 2, 5 or 10. As I researched the inserter upgrades, I increased to the next size in the list.
This means that each inserter swing, the group will load 5, 10, 25 or 50 items. These are all multiples of the stack sizes.

As long as all stations work like this, and wagons are always emptied in the same manner (eg emptied of whole stacks), you can never end up with part stacks in a wagon.

Unfortunately this method won't work once a wagon or inserter becomes "jammed".
The risk i can see is that if one of the material used to load the train run dry temporarily, it may cause some inserter to pick less than their set limit say 4 instead of 5.

One can also use circuits there, to "enable" inserters only if there is enough material for them to pick up their full capacity so they stay in sync.

I suppose player using LTN mod though only have trains moving around when their destination station has enough material to load them or enough room for a full unload, by feeding all chests the same amout of material, mesuring the content in 1, and multiplying by the number of inserters. Which is a way of solving 2 problem at once but require quite good understanding of combinators :)

robertsonj
Inserter
Inserter
Posts: 22
Joined: Thu May 14, 2020 4:08 am
Contact:

Re: Inserter jams when loading cargo wagon

Post by robertsonj »

mmmPI wrote:
Fri Nov 03, 2023 10:01 am
The risk i can see is that if one of the material used to load the train run dry temporarily, it may cause some inserter to pick less than their set limit say 4 instead of 5.

One can also use circuits there, to "enable" inserters only if there is enough material for them to pick up their full capacity so they stay in sync.

I suppose player using LTN mod though only have trains moving around when their destination station has enough material to load them or enough room for a full unload, by feeding all chests the same amout of material, mesuring the content in 1, and multiplying by the number of inserters. Which is a way of solving 2 problem at once but require quite good understanding of combinators :)
Good point, yes I configure LTN so that it only sends a train if there is enough items to fill the slots and space to unload.
Using the circuits as you suggested would solve this without LTN.

Post Reply

Return to “Gameplay Help”