Stations & other LTN based designs

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Stations & other LTN based designs

Post by Optera »

Share your designs for anything LTN related.

I'll go ahead by adding my station designs in the next post.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Depot, Requester, Provider

Post by Optera »

Depot for LTN 1.10.13
Capable of servicing any train size and composition.
This depot is protecting the network against residual items pollution. When a train with left over cargo enters it will remove the depot flag, probably switching the stop into duplicate name error state, and hold the train there safely until all cargo is cleaned out.
The constant combinators holds pre calculated 2^n values for train composition decoding up to 10 carriages.
Depot disabling itself on left over cargo (requires 1.9.0)
Depot disabling itself on left over cargo (requires 1.9.0)
2018-10-12-08-26-04-6024608.png (827.34 KiB) Viewed 128519 times



Usage:
  • place blueprint
  • Name the depot. Trains will find back to their depot by name
  • train composition signals allow this design to service any train composition
    To service specific locomotives change the signal in the arithmetic combinator from "encoded positions of every locomotive" to "encoded positions of <locomotive name>"
  • Send at least one train in automatic mode to the Depot
  • Schedules will be generated automatically and sent to trains waiting in depot
  • (optional) add a constant combinator feeding network id into the lamp to limit trains to certain networks
Requester
This station can handle multiple items and will only unload items scheduled to unload.
Note: since the inventory signal is 1 tick ahead of the subtracted correct unloading amounts the first inserter cycle might unload unwanted items.
2017-06-11-LTN Requester.jpg
2017-06-11-LTN Requester.jpg (164.43 KiB) Viewed 151051 times



Usage:
  • Connect the chests to the input (lamp)
  • Connect the yellow constant combinator to an arithmetic combinator
  • merge the negated output with the train inventory signals from the stop
  • feed the signal to filter inserters set to filter mode
  • Connect a constant combinator to the input with at least the negated amount of requested items/fluids
    setting request threshold, limit train size, asf per stop is generally a good idea for networks with multiple items
  • When a train arrives the expected train inventory is sent from the output alongside the train composition.
Requester v2 for LTN 1.10.13
This station can handle multiple items and will only unload items scheduled to unload.
Fixes the old requesters glitch of moving one cycle of any item in inventory before the subtracted signal properly kicks in.
Requester v2.3
Requester v2.3
2019-08-03-12-44-25-0902456.png (147.91 KiB) Viewed 109687 times



Usage:
  • Set up like normal Requester
  • decider combinator is set to any cargo wagon signal making inserters only work once every signal path has entered the decider
Provider
This station can handle multiple items and will only load the amounts scheduled to load.
Note: Overloading up to 1 cycle per inserter is possible, use locked slots per wagon signal.
2017-06-11-LTN Provider.jpg
2017-06-11-LTN Provider.jpg (158.29 KiB) Viewed 151051 times



Usage:
  • Connect the chests to the input (lamp)
  • (Recommended) Connect a constant combinator to the input setting provide threshold, limit train size, asf
  • When a train arrives the expected train inventory is sent from the output alongside the train composition.
Last edited by Optera on Mon Jun 25, 2018 4:45 pm, edited 8 times in total.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Provider/Requester in one stop

Post by Optera »

Basic Provider & Requester
This stop can supply/request any number of items.
To prevent timing issues (stop output is some ticks faster than the yellow combinator) it's waiting until train decoding signals are available before sending unloading signals.
Unloading logic uses 2 times unload amount to prevent unloading provided material once a train is slightly overloaded.

Basic Provider &amp; Requester
Basic Provider & Requester
2020-02-18-20-26-28-6665583.png (185.01 KiB) Viewed 95716 times
Pro:
  • very versatile
  • fast loading/unloading
Con:
  • sorting multiple items from steel chests (I'm using merging chests and loaders)
  • inserters can lock up
    requires some tuning between stack size bonus and locked slots/wagon to prevent stuck inserters.

Logistic Provider & Requester for LTN 1.10.13
This is the version I use for my supply trains. Same principle as above, but it also makes use of train composition to activate only when a cargo wagon is parked in a loading bay.

Logistic Provider &amp; Requester
Logistic Provider & Requester
2019-07-30-22-34-06-0663710.png (173.82 KiB) Viewed 109921 times
Pro:
  • extremely versatile
  • bots will automatically sort items from active provider
Con:
  • slow loading/unloading, only useful for small amounts
  • inserters can lock up

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Logistic Network to LTN stop filter

Post by Optera »

Hooking Logistic Network directly to LTN stops has some side effects due to how logistic network reads its contents.
1) Logistic network doesn't show items in transit as available potentially causing another delivery in a bot unloading station design.
2) If bots try to pick up more than available the number becomes negative, which is LTN's trigger for requesting this amount.

To combat these effects I put together this signal filter.
2017-06-30 Logistic Filter.jpg
2017-06-30 Logistic Filter.jpg (78.46 KiB) Viewed 156922 times
Green sets the amounts of desired items as usual for LTN with negative sign.
Red (optional) filters signals entirely.

Features:
- Filters negative signals from roboport.
- Filters signals set in unwanted CC (red)
- Signals set in green cc (requested) are only shown when negative to prevent pickup/delivery circle.



Note:
When used with LTN stops it will require an additional cc setting LTN parameters.

User avatar
Odhrean
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Mon Sep 15, 2014 7:49 am
Contact:

Re: Stations & other LTN based designs

Post by Odhrean »

I designed a blueprint-book with different LTN-Stations for different use-cases.

You can download and comment the Stations in the Chunk-aligned modular railway system with LTN Stations-Thread.

Version 1.5 is released with major improvements to the Stations.

Here is a short preview of some Stations in the Book:
LTn-Stations

SomeDutchGuy
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jul 29, 2017 12:48 pm
Contact:

Depot For 3-10-3 Trains

Post by SomeDutchGuy »

I'm not entirely clear on how the encoded train positions work, especially above 10 cars. Can anyone put together a simple depot for a 3-10-3 train? Thanks!

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Depot For 3-10-3 Trains

Post by Optera »

SomeDutchGuy wrote:I'm not entirely clear on how the encoded train positions work, especially above 10 cars. Can anyone put together a simple depot for a 3-10-3 train? Thanks!
Here's an updated 2 circuit, length 12 depot with 2 constant combinators containing all 2^n values for 32 carriages pre calculated. Making it longer is as simple as going up one signal by carriage.
If you want even more than 32 you're out of luck with 32bit integers.
2017-07-29-17-15-53-7070918.jpg
2017-07-29-17-15-53-7070918.jpg (82.1 KiB) Viewed 156523 times

SomeDutchGuy
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jul 29, 2017 12:48 pm
Contact:

Re: Stations & other LTN based designs

Post by SomeDutchGuy »

Perfect, thank you!

lperkins2
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Mar 10, 2017 9:19 pm
Contact:

Functional Auto Loaders and Unloaders (blueprints)

Post by lperkins2 »

So first off, I want to be clear that I love this mod. I don't think I could play Factorio any more without it. That said, the serious lack of decent blueprints to go with it is rather painful. I spent probably an hour trying to find a decent loader and unloader, and ideally a hybrid blueprint too. At first I was looking for ones that would handle a mixed station, ideally even mixed storage chests; I was disappointed. Then I decided I'd settle for monotypic ones, as long as they actually load/unload the correct quantity. Once again, I was disappointed. Even the blueprints included in this forum simply fail to reliably deliver the proper amount of goods; supposedly they are tunable, but the tuning changes as your stack inserter research progresses. Rather than settle for barely adequate solutions, I decided to make my own. It isn't perfect, and I would absolutely love feedback. So far I've only got the 1-wagon loader done, but I'll post the rest as I get them properly working.

Also, to be able to truly handle any request, you need a way to grab the max signal. You can hardcode a bunch of checks, set up at each station, but I wanted it to be fully dynamic. I forked UsefulCombinators and made the Max Combinator operate without filters, and output the magnitude of the max signal. We'll see if its maintainers want to merge the pull request, but in the meantime, you can get my fork of it here. A way to pull a single signal from the list (same signal from the station connection and the output connection) would be great, but I can't figure out how to do it without hardcoding or using the UsefulCombinator.

Anyway, the station...

Image
blueprint
The arithmetic combinators on the right cancel out the train encoding, and reduce the requested amount by the train's current cargo.
The blue combinator is the max-combinator, which selects the most missing thing (green wire) and outputs it. Note that the count output is 1 higher than the input value.
The decider combinator north of the max combinator shuts down the left most loader when the train has all its cargo.
The other decider combinator shuts down the rest of the loaders when the train is almost full.
The arithmetic combinators decrease the stack size as the cargo fills, to avoid over filling.

This works incredibly well for filling a single train, even if multiple types of items are requested and the chest contents are mixed. The unloader will work basically the same way, in reverse.
The major issue is if you scale it up to multiple cars, and have a mixed payload, the wagon might be full, thereby blocking the inserter. If there is only one type of stuff, it's not a problem, since the last inserter tends to be a bit slower than the others, so the wagon with it should fill last.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Stations & other LTN based designs

Post by Optera »

Moved to design thread.
That said, the serious lack of decent blueprints to go with it is rather painful. I spent probably an hour trying to find a decent loader and unloader, and ideally a hybrid blueprint too.
What's the problem with my original designs in combination with a zuri loader?

Image

lperkins2
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Mar 10, 2017 9:19 pm
Contact:

Re: Stations & other LTN based designs

Post by lperkins2 »

Simple. Start with all the chests full of copper ore (or at least 350ish in each). Ask for a delivery of a prime number of ore (1001 is what I did), or at least not a multiple of your stack inserter capacity. Watch as the train gets too much stuff, then fails to fully unload at the destination because there isn't room for the excess. This also isn't addressing the issues that arise if you have mixed types of items in the chests, and need 300 of one type and 1000 of another, which the loader I designed can handle beautifully.

The unloaders have exactly the same problem, offer a train with 1020 items, order it to unload 1001 items, watch it empty itself, which will happen thanks to the problem with the loaders loading too much.

Note that the loader configuration for loading the chests doesn't matter, I'm assuming I'll be able to keep the chests pretty much completely full.

Edit: As for the extra combinators in the picture (relative to a simple zuri configuration), they let it load the chests with mixed item types.

torne
Filter Inserter
Filter Inserter
Posts: 342
Joined: Sun Jan 01, 2017 11:54 am
Contact:

Re: Stations & other LTN based designs

Post by torne »

I have similar station designs for loading/unloading which don't require the max combinator, but instead have two problems that are relatively minor in my setup: they occasionally load a few too *few* of an item if the arrangement of the supply isn't fully balanced across the input chests, which is tricky to perfectly maintain for multiple-item stations (though easy for single-item with the madzuri loader), and certain combinations of order for a multi-item station cause one of the inserters to run slower than necessary (but the total load time is generally not much worse). I can post blueprints sometime when I clean them up :)

They do still have the same problem that it doesn't work for multiple cars with mixed payloads. I currently just avoid this in my factory: I use multi-car trains for transporting ores and the like with single-item stations, and single-car trains for mixed products (which works fine as I'm using angels+bobs and so I have a very large number of assorted different products that are often useful to transport in lower quantities, such as the rolls of wire/metals that angel's smelting provides).

I think it could be fixed for multiple cars by using the inventory sensor mod to read each car separately and simply dividing the "order" by the number of cars and handling each car separately - that will also under-load due to rounding and will require balanced input chests to work, but that's probably okay. Just haven't experimented with it yet.

Edit: Oh, the other thing I was going to mention is that the reason I'm trying to load exact amounts is that while the locked slot parameter in LTN makes this largely a nonissue for most stations, I have a bunch of stations that serve a dozen or more items, and so may have to lock a dozen or more slots per wagon, which makes the capacity of trains somewhat disappointing :)

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Stations & other LTN based designs

Post by Optera »

I like when someone comes up with intricate combinator designs to solve a problem.

However I can see my laptop struggling with that design as combinators are not the most performance friendly solution. For that I'm using a 41x1 chest from Wide Chests running along a whole train taking care of balancing in the most performance friendly way.
Alternatively a lot of players use 6x6 Warehouses either from Angel's Addons - Warehouses or Warehousing Mod to have a large chest balanced per wagon.
lperkins2 wrote:The unloaders have exactly the same problem, offer a train with 1020 items, order it to unload 1001 items, watch it empty itself, which will happen thanks to the problem with the loaders loading too much.
I generally set request amounts so there always are some slots free in chests.

torne
Filter Inserter
Filter Inserter
Posts: 342
Joined: Sun Jan 01, 2017 11:54 am
Contact:

Re: Stations & other LTN based designs

Post by torne »

Yeah, you can avoid any possible problems caused by unbalanced buffer chests with mods that let you have a single storage for all the inserters on the train, and that's fine, but it's not directly related to not loading too much :)

Leaving slots free in chests at the destination avoids it getting stuck when unloading, but it doesn't avoid the loading inserters ending up with items in their hands; I'm guessing you're using the locked slots per wagon feature for that since you added it, but like I said that doesn't work so well for stations that provide a large number of different products, as you have to lock too many slots to guarantee you never overload.

lperkins2
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Mar 10, 2017 9:19 pm
Contact:

Re: Stations & other LTN based designs

Post by lperkins2 »

torne wrote:I have similar station designs for loading/unloading which don't require the max combinator, but instead have two problems that are relatively minor in my setup: they occasionally load a few too *few* of an item if the arrangement of the supply isn't fully balanced across the input chests, which is tricky to perfectly maintain for multiple-item stations (though easy for single-item with the madzuri loader), and certain combinations of order for a multi-item station cause one of the inserters to run slower than necessary (but the total load time is generally not much worse). I can post blueprints sometime when I clean them up :)

They do still have the same problem that it doesn't work for multiple cars with mixed payloads. I currently just avoid this in my factory: I use multi-car trains for transporting ores and the like with single-item stations, and single-car trains for mixed products (which works fine as I'm using angels+bobs and so I have a very large number of assorted different products that are often useful to transport in lower quantities, such as the rolls of wire/metals that angel's smelting provides).

I think it could be fixed for multiple cars by using the inventory sensor mod to read each car separately and simply dividing the "order" by the number of cars and handling each car separately - that will also under-load due to rounding and will require balanced input chests to work, but that's probably okay. Just haven't experimented with it yet.

Edit: Oh, the other thing I was going to mention is that the reason I'm trying to load exact amounts is that while the locked slot parameter in LTN makes this largely a nonissue for most stations, I have a bunch of stations that serve a dozen or more items, and so may have to lock a dozen or more slots per wagon, which makes the capacity of trains somewhat disappointing :)
Blueprints sound great, even if they aren't tidy. You can probably work around the not loading everything by adding a secondary slow loader that tops the train off, which is basically what my setup uses.
As for balancing between cars, you can avoid under loading by calculating the modulo and adding it to the first car. For example, 3 cars loading 1k items. Each loads 1000//3, the first loads 1000//3 + (1000-1000//3*3).
The slightly more proper way would be to have the first N cars (where N is the modulo) load 1 extra item, but that would be harder to wire.

Optera wrote:I like when someone comes up with intricate combinator designs to solve a problem.

However I can see my laptop struggling with that design as combinators are not the most performance friendly solution. For that I'm using a 41x1 chest from Wide Chests running along a whole train taking care of balancing in the most performance friendly way.
Alternatively a lot of players use 6x6 Warehouses either from Angel's Addons - Warehouses or Warehousing Mod to have a large chest balanced per wagon.

I generally set request amounts so there always are some slots free in chests.
Yeah, I wish there was a 'sum' meta signal, that you could use. Each of the extra combinators just takes 'everything' and outputs 'Z', which means it outputs the sum of the items in the chest. If I weren't running it on a fast 6-core machine I'd probably use dedicated chests. As is, I only have a few stations that need to handle mixed crap (I'm running harder crafting, so all the mining outputs scrap too). The train loader itself only uses 9 combinators.

It is certainly possible to work around the limitations in the existing loader blueprints, and as you pointed out, they do have a lower impact on the computer. Also, with the loaders working properly, the trains are almost always supposed to completely empty themselves. I mostly intend to design the precision unloaders for the sake of completeness.

torne
Filter Inserter
Filter Inserter
Posts: 342
Joined: Sun Jan 01, 2017 11:54 am
Contact:

Re: Stations & other LTN based designs

Post by torne »

lperkins2 wrote:Blueprints sound great, even if they aren't tidy. You can probably work around the not loading everything by adding a secondary slow loader that tops the train off, which is basically what my setup uses.
I use one of the inserters to do exactly that, reverting to stack size 1 when the train is just about full, but the problem is that if the chest in front of that particular inserter has run out of the item (either because the chests are unbalanced, or because there are <6 of that item left and all of them happen to be in one of the other chests) then it won't be able to do it and the train will just leave after the inactivity timeout. If you balance the chests properly it will only happen when you're low on stuff anyway, but some of my stations are too cramped for proper multi-item balancing and so end up out of balance occasionally (I try not to build them like that any more).
As for balancing between cars, you can avoid under loading by calculating the modulo and adding it to the first car. For example, 3 cars loading 1k items. Each loads 1000//3, the first loads 1000//3 + (1000-1000//3*3).
The slightly more proper way would be to have the first N cars (where N is the modulo) load 1 extra item, but that would be harder to wire.
Neither of these methods will work if you are loading multiple items: e.g. if you have three cars, but also three item types, each loading one car's worth, then when rounding down this will work, but if you try to add in the modulo in either of the ways you describe then it will attempt to overfill the first car and get stuck. You'd have to be able to distribute the remainders equally across the cars, across multiple item types, which sounds hard :)

I'll have to build your station blueprint when I have time to play and compare it to mine, and see if I can make one that actually works approximately how i want for multiple cars, but right now my factory is just entirely built for each station to be (one item, multiple cars) or (multiple cars, one item), never both :)

lperkins2
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Mar 10, 2017 9:19 pm
Contact:

Re: Stations & other LTN based designs

Post by lperkins2 »

Yeah, that all makes sense. I suppose the simple solution would be a timer that ensures all the inserters fire one at a time, sequentially. It would only need to kick into that mode once the train was mostly full. It would probably either need a fancy mod's combinator, or be painfully hard on the CPU.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Stations & other LTN based designs

Post by Optera »

LTN is designed to have trains slightly overloaded, that's why all my designs are made to start one more stack than requested. I had to limit loading to 5 inserters at 10 items so it doesn't start 2 stacks for items stacking at 50.

Like torne said earlier Locked Slots per Wagon may waste some space in wagons when designing requesters to grab dozens of items at once. Since those should only be used to ship minuscule amounts like 1-2 stacks anyway I don't see it as an issue.
For those supply runs I use the logistic design from this post without any stack limit. In late game a single stack inserter can load a 200 stack of ammo in 1-4 cycles, those things become ridiculously op with inf tech. ;)

Mass requests, like ore and plates, work best with request threshold = train capacity - 1 slot/wagon and providers providing only 1-2 items.

spinba11
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Mon Mar 07, 2016 9:07 pm
Contact:

Re: Depot For 3-10-3 Trains

Post by spinba11 »

Optera wrote:
SomeDutchGuy wrote:I'm not entirely clear on how the encoded train positions work, especially above 10 cars. Can anyone put together a simple depot for a 3-10-3 train? Thanks!
Here's an updated 2 circuit, length 12 depot with 2 constant combinators containing all 2^n values for 32 carriages pre calculated. Making it longer is as simple as going up one signal by carriage.
If you want even more than 32 you're out of luck with 32bit integers.
2017-07-29-17-15-53-7070918.jpg
bp string
What would the 13th car's value be (the 12th cars vlue is 1)?

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Depot For 3-10-3 Trains

Post by Optera »

spinba11 wrote:
Optera wrote: Here's an updated 2 circuit, length 12 depot with 2 constant combinators containing all 2^n values for 32 carriages pre calculated. Making it longer is as simple as going up one signal by carriage.
If you want even more than 32 you're out of luck with 32bit integers.
2017-07-29-17-15-53-7070918.jpg
bp string
What would the 13th car's value be (the 12th cars vlue is 1)?
position 12 is signal B, position 13 is signal C

Post Reply

Return to “Logistic Train Network”