Smart unloading station with waiting bay (0.15.11+)

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.
mrvn
Smart Inserter
Smart Inserter
Posts: 5860
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Smart unloading station with waiting bay (0.15.11+)

Post by mrvn »

Hi,

I just finished my first working version of a smart unloading station using two new features: station disabling (0.15) and reading stopped train (0.15.11).
Overview
Closeup
The station has the following feature:
Stations not ready for trains are disabled
When there are multiple stations with the same name the trains will drive to the nearest (free) station. By disabling stations that wouldn't allow trains to enter all trains targeting that station are redirected instantly. Normally that only happens when they get blocked at some signal.
Has a waiting bay
The waiting bay allows one train to unload and one train to wait behind it. Once the first train leaves the second can quickly reach the station and start unloading. This minimized the interval between trains considerably, more so the farther away they have to travel.

Normally a waiting bay will conflict with disabling stations because the second train will skip to the next station on its list if all unloading stations are busy. Trains wait at the "pre" station until they get a signal to move on and that is timed with the following unloading station to be empty and enabled. A waiting bay train will always go on to the following unloading station.
Unloading never blocks
The station keeps track of the amount of items in the buffer chests, in the hands of the inserters doing the unloading, in the wagon being unloaded, the wagon in the waiting bay and even said wagon while it drives from the waiting bay to the unloading stop.

The unloading station has therefore always an exact count of items that will be unloaded. The waiting bay is only enabled if a full train car can be unloaded into the buffer chests. A train will therefore never be stuck in the station waiting for items to be consumed so it can be unloaded.

This allows for fewer trains to service more stations and adjusts to demands. A slow consumer will only get one train every so often while a fast consumer will get trains in its waiting bay.
Trains won't stop on the main track
With a single waiting bay the signals will normally prevent a third train from entering the station. The train will then sit in front of the branch to the stations and block traffic until it gets re-path-ed. Worse, if there are more trains than unloading stations or it doesn't feel like it then it might not switch to another station.

Not so when using disabled stations. As soon as a station is disabled all trains targeting that station will switch to another station with the same name or skip that station. Due to the chain signals used at the entry this happens while any train is still on the main track and it will keep on driving. Due to the way the stations are disabled it will also always skip the unloading station when it skips a waiting bay station.
Tips about the design
- The stations have a green light that shows if they are enabled. The waiting bay also as a red light that shows if a train is allowed to leave the station.
- The combinators are placed so that signals run from bottom to top. Each combinator is one higher than its highest input. This is just so I can keep track of signals delays.
- Each station has a edge trigger for the T signal. In the waiting bay it stores the train contents in a memory cell while at the unloading stop it clears the memory cell. This keeps track of the train contents while it moves between the two stops.
- There is also a SR flip-flop to generate the go signal for the waiting bay.
- A bunch of combinators are just there to add a delay to a signal.

Figuring out which is which is left as an exercise to the reader. :)
Attachments
waiting-bay.zip
Savegame of smart station in action
(3.85 MiB) Downloaded 184 times
mrvn
Smart Inserter
Smart Inserter
Posts: 5860
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Smart unloading station with waiting bay (0.15.11+)

Post by mrvn »

After some sleep I added some explanation of what each combinator does.
Explanation of combinators
Explanation of combinators
Explanation of combinators
smart-unloading-explained.png (4.81 MiB) Viewed 6193 times
kaldskryke
Inserter
Inserter
Posts: 27
Joined: Mon Nov 17, 2014 3:49 am
Contact:

Re: Smart unloading station with waiting bay (0.15.11+)

Post by kaldskryke »

Thanks for sharing this mrvn,

I was having troubles understanding how trains behave when I disable stations and your system here helped clear that up. Hopefully I'll be able to adopt a simplified version of your system to fix my No Path problems.
Post Reply

Return to “Railway Setups”