User:X-BT/Zipper merge
From #openttdcoop wiki
This is an attempt to reduce the gap between trains traveling on a track, also called compressing. It is based on the zipper-principle used when merging two lanes on a densely trafficated road, alternating equally between the lanes. The basic idea of my implementation is to hold back every train for a short while at one of the tracks to make gaps that a train from the other track fits perfectly into. Then every train on the other track is also stopped and released at the right time so that it will merge perfectly into the gaps on the first track. This is done entirely by the use of presignal logics, and it is quite simple to achieve. This construction is often called a compressor.
In this example I have trains with a considerable difference in acceleration. These may not be mixed before the merger. Also since I am using single headed steam trains, the valuables trains barely manage to reach full speed before the merge point. With this long acceleration stretch I had to add a more complex jam detection system than I have used earlier.
Construction guide
1 ) Start by building two tracks that merge. Decide which track shall generate gaps, and which shall merge into the gaps. The tracks must be long enough for the trains to accelerate to full speed before the merge point.
2 ) Construct the gap generating signal (A). This shuld be a pre-signal followed by an exit-signal at the next tile. The example has a more complex jam preventing feedback, that may be implemented later when everything is tuned. Until then you may have stop the waiting trains to clear jams.
3 ) Construct the two normal signals pointed at by the arrows (C), and the connection between the block before and after these two signals (the one with the middle combo-signal in the example). The distance between signal (A) and the first of these two singals determines the gap size (no signals here, except for the exit-signal). Let this distance be large at first, then tune it later by moving signal A closer. As indicated, signals (C) should have room for one train between them.
4 ) Construct the release signal (B) for the other track. This signal is controlled by the trains at the first track. Under normal operation it turns green when a train is in the block between signals (C). That is also the condition for signal (A) to turn green, so trains start simultaneously at both tracks.
Tuning
Time to let the trains enter the merger and see how it works.
1 ) Move signal (B) so that the trains coming from it gets as close to the trains from (A) as possible. Moving it closer to the merging point reduces the gap. Make sure that they merge without slowdowns. If a jam occur and presists, just stop a train waiting at signal (B) until it clears.
2 ) Move signal (A) to make trains from (A) get as close to trains from (B) as possible. Congratulations, it is now tuned for (almost) minimal gaps.
Jam detection and clearing
The idea is to stop releasing trains when there is a jam at the merge point. It may be enough to stop the trains at (B) from releasing, since trains from (A) have large gaps that should absorb the jam. With the slow acceleration of the steam trains, I found it best to stop both releases until track was cleared. The key point when adding the jam detector is to detect that a train is in a specific place where it should not be when the trains are released. To get it right you have to make it run properly, then take a note of where the trains are when the next couple is released (on singleplayer you can use the pause button). Then you can add feedback from blocks that contains no trains at release time during normal operation. The feedback can be from one or both of the two tracks (I belive it is best to connect from both when stopping both releases). If no such train free blocks exist close to the merging point, move the merging point one or more blocks down the line.
Notes
- The merger must have trains waiting at both incoming lines for optimal operation. If there are too few trains, it might happen that one of them does not come to a complete stop before release, and a jam is most likely to occur.
- For equal acceleration it is possible to place signal (B) perfectly before tuning (can you figure out where it should be relative to signals (C) ?).
- For different acceleration the slowes ones should probably go on (A) since they require longer acceleration stretch.
- Diagonal tracks cause problem for compressed lines. For a single S-bend add extra signals about one TL prior to the bend.
- Gaps may be fine tuned with the use of diagonal tracks. For instance try to change which track goes straight at the merge point.
Variants
In PSG 149 I made a variant where the logics is placed between the two tracks, rather than on the sides. This probably conserves some space in most cases. It is possible to add a bypass to let the trains at (A) tun contineously when the queue at (B) is empty. (Trains at (B) runs contineously if there are no trains at (A))