Single Cargo Wagon Loading/Unloading Station

Smart setups of railway stations, intelligent routing, solutions to complex train-routing problems.
Please provide - only if it makes sense of course - a blueprint of your creation.
Post Reply
feng
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Jun 25, 2016 1:17 pm
Contact:

Single Cargo Wagon Loading/Unloading Station

Post by feng »

Hey,

my objective was to use one cargo wagon only per train for loading and unloading items. I.e. the train delivers iron ore from your mines to your base where it gets unloaded by the inserters. After the unloading process the same cargo wagon shall be loaded with items you need at the iron ore mines like repair kits and bots.

So after some hours of messing around I finally present you the Smart Unloading and Loading Train Station!!! ;)

In this screenshot you will see some different creations that are not all connected to the train station but I will explain them all nevertheless.

Image

The Principle:
After train arrival the cargo wagon gets unloaded. But only the items I need at that particular base (of course) plus the item types I want to load into the train later (so I do not overfill the train). When the unloading process is done I start to load the train with a pre-defined amount of different items. Because I have unloaded that item type before I can assume that the train will leave the train station with the pre-defined amount. So no overfilling. The train will leave after 5 seconds of inactivity.
The interplay with the loading and unloading inserters is realised with a multiway power switch. After the unloading process the unloading inserters are shut down while the loading inserters are powered up.

The Problems:
Serious, there were a lot of problems to solve. Wall of text incoming:

- Fast multitype loading and unloading: The train shall block the train station as short as possible. The possibility to use multiple item types within a single cargo wagon is important.
A fast way would be to use 6 white smart stack inserters. Unfortunately they have only 1 filter slot. Luckily we can set the filter type with circuit networks. So I used a combination of 5 white smart stack inserters (slaves) and 1 purple smart inserter (master) as that one has 5 filter slots. Connected within the same circuit network the slaves start to unload the same item type like the master inserter.

Image




- Loading in a pre-defined amount of items: The train shall be loaded with a limitless amount of item types. The filter option of the cargo wagon is not desirable, as this can block stack inserters. Multiple chests/inserters per item type is not desirable as this limits the possible item types to 6. The train shall not get overfilled.
As we do not know how many items are already in the train we have to unload these items first. For that reason the unloading inserters are also unloading the item types we usually want to load into the train. (That leads to the problem that the newly loaded items are getting instantly unloaded again. The solution to this is explained further below.)
So that we have unloaded the train, we are ready to load the new items. I used a circular transport belt solution or in short... a sushi bar. :)
The items are stored in chests in front of the sushi bar. The sushi bar gets filled with items that shall be loaded into the train. The whole sushi bar and rail chests are connected to a circuit network. The stack inserters will only put a pre-defined amount of items onto the sushi bar which will then get into the rail chests. When the inserters get powered up they start loading in the items from the chest into the train. But that also means that the item count in the circuit network gets reduced as we have no access to the train content. That would usually lead to refilling the sushi bar (and finally the train) from the buffer chests in front of the sushi bar. To prevent that I have installed a power switch that will power off the inserters when a train is inside the train station. Have a look at the train signal at the entrance of the train station. When that signal turns red (means a train arrived) the power switch disconnects the inserters at the storage chests.

As we disconnect the storage inserters from power when a train arrives, we must be sure that all desired items are already in the rail chests before a train arrives. For that reason the sushi bar is also connected to the entrance rail signal. As long as there are items on the sushi bar (which will get filled by the inserters) the entrance signal stays red. So new trains are only allowed to enter the station when all desired items are in the rail chests. When the train leaves the station it triggers another combinator logic which lets the rail chests refill while still blocking other waiting trains at the station entrance until the rail chests are filled again.

//offtopic: I discovered a bug while messing around with the situation. It seems that powered off inserters still grab items out of the train (perhaps buildings and chests as well). They are not moving, they just get it in their hooks, which leads to wrong results if you rely on reading inserter contents. I need to double check that, before I report that issue.

Image




- Prevent the inserters from unloading new items: When the train gets loaded the unloading inserters usually start unloading again. We must establish a two phases solution. Phase 1: Unloading, Phase 2: Loading.
Thanks to the new power switches we are able to build a multiway switch. The power switch condition is as follows: Turn the unloading inserters off and the loading inserters on, when there are no more items on the unloading belts. I assume that the unloading process is done when the 3x6 lines of belts right from the rails are empty. But that also means that the unloading inserters are off when a train arrives as the belts are empty as well. I used a little trick for that. Have a look at the circular belt on the top left. This is a timer belt. I have placed only one item on that belt. That item is stopped at one of the belts. The other belts are part of a circuit network. When a train arrives the item starts moving around the belts and triggers the power switch for some seconds. So the inserters get power and can start unloading. When the item on the timer belt is stopped again the unloading inserters must trigger their power switch themselves by unloading items on the belt. If no items are left, the power switch triggers and the loading process starts. As the unloading inserters have no power, they can not unload our cargo wagon while it gets filled with new items.

Image




A Chronological Sequence In Detail:

So what happens if a train arrives?
The initial situation is as follows:
On the left side you see 2 stack inserters responsible for repair kits and construction bots. They are connected to a circuit network together with the red transport belts and the 3 chests to the left of the rails. With that setup I can define how many repair kits and construction bots I want to be in the chests when a train arrives and finally get loaded into the train.

You see the 4 white smart inserters on the right of the rails. These are slave inserters without a filter set. The purple smart inserter above them is a master inserter. The 5 available filter slots are set to the item types I want to unload. The signal of the picked up item is then broadcasted to the white inserters so they start also unloading that type of item. Due to the multiway power switch configuration, the unloading inserters are powered off and the loading inserters are powered on.
Now, the train arrives and passes the entrance rail signal. This triggers the timer belt on the top left, which triggers again the power switch for the unloading inserters. The timer belts now give power to the unloading inserters for some seconds. Enough time to start the unloading process. Then the timer belts goes off and the unload inserters should trigger their power switch by themselve by unloading items on the circuit belts. After they have emptied the cargo wagon the circuit belts get empty as well, triggering the power switch. Now the loading inserters start to load their items into the train. The amount got counted before by the circuit network at the storage chests. So when the chests got emptied the train leaves after 5 seconds the train station. A new waiting train is still not allowed to enter the station as the loading chests on the left of the rails get refilled now. When the refill process is done, the entrance signal changes to green and a new train is allowed to enter the station and the whole process starts again.

The Other Creations:

- Sushi Bar: Well, its just a circular belt. You see two of them. A small one for loading the rail chests and a bigger one for the unloaded items. Usually you will need more smart stack inserters per item type to unload the sushi bar. Just build as many as you need. The intention is that you only need one unloading station that unloads everything without sorting anything. On the sushi bar smart inserters take the items they are configured for.

- Balanced 6 to 1 Joiner: I hope I did it right, but the first tests were very satisfied. The objective of this joiner is to fill the output belt at full capacity as long as any of the 6 input belts inserts enough items for the output. The principle behind it is simple. The output belt uses two sides. Left and right. So we have to split the items equally to the left and right side. The left (or top) outer input belts splits 50:50 to the right (or bottom) outer input belt. The second top splits 50:50 to the second bottom belt and so on and so on. That results that the single output belt will always be at full capacity as long the 6 input belts deliver enough items.

- Anti Clogging Splitters: The design of the sushi bar tends to clog if there are too many items on the belt. So if every belt part is at full capacity the sushi will stop moving. With the anti clogging splitters the sushi bar will always move at full speed, even if there is no free space for new items left.

Conclusion:
While building this creation I felt more and more that it is getting really complicated. People will say "naaah, I just use a second wagon for delivery" and they are right. It is much more easier to use other solutions, but hey.... we do not play factorio to do the easy way, right? ;)

ToDo-List:
That solution is still not perfect. Especially the refilling process of the loading rail chests takes too much time I think. So that could need some improvements. Later... perhaps ;)

Finally a short movie that shows the station in action:

https://www.youtube.com/watch?v=-JFd0osOG7s


I hope you like it. Let me know about your thoughts.
Savegame attached.

Greetings
Attachments
Train Station.zip
(5.41 MiB) Downloaded 128 times

MindChanger
Fast Inserter
Fast Inserter
Posts: 110
Joined: Tue Jul 05, 2016 6:53 am
Contact:

Re: Single Cargo Wagon Loading/Unloading Station

Post by MindChanger »

You can check systems of loading single wagon with supplies from the link below which I think can be faster solution and supports more item types.
viewtopic.php?f=8&t=28268

If you want you can use it, upgrade it and use with your solution.

BTW can you tell me how to connect power switch to power network? When I put switch it doesn't connect automatically to power network.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Single Cargo Wagon Loading/Unloading Station

Post by Nexela »

MindChanger wrote: BTW can you tell me how to connect power switch to power network? When I put switch it doesn't connect automatically to power network.

Use the copper cable item to link power just like you use the red and green wires to link circuit network. Also shift-clicking an entity with power wires will first remove all power wires connecting it and a second shift-click will remove all circuit wires

MindChanger
Fast Inserter
Fast Inserter
Posts: 110
Joined: Tue Jul 05, 2016 6:53 am
Contact:

Re: Single Cargo Wagon Loading/Unloading Station

Post by MindChanger »

Thanks!

Post Reply

Return to “Railway Setups”