I've built a rail system for some minecarts to transport items from my mineshaft back to my base, with a load/unload system. However what I'm trying to achieve is to get two minecarts working on the same single run of track at the same time.
To achieve this, at the mineshaft end of the track, I'm trying to use detectors to detect an approaching minecart returning after unloading from my base (B), and launch the loading minecart (A), and prevent them from colliding by switching the track at the junctions.
The image above shows the basics. I've used a powered rail under the loading minecart (A), and a detector on the track which powered the powered rail. I've tried all sorts of combinations of junctions (using detectors to switch them), but all my attempts so far have been fruitless. Can anyone suggest a solution?