I've been kicking around the idea of using a PIC microcontroller to handle the logic for detection in my staging yard. Each staging track can handle 2 stacked trains of typical length (I just don't have the width to make more but shorter tracks) so I worked up an idea using 4 IR detectors (either the ones on Rob Paisley's site or the one presented in MR recently, with the corrections and modifications posted here). I posted a PDF of my document and drawings on my web site, also linked here:
http://www.readingeastpenn.com/images/IRStagingDetection.pdf
The idea is the operator will be able to park a train in staging just by followign the LEDs (as long as they keep the speed down!). Normally the staging tracks iwll not be visible, they will be hidden behind a removeable backdrop (in case of oops).The stagin at the south end of the railroad you theorectically could peek behind the backdrop and see if you stand at the right palce, but where's the fun in that? I've been having fun figuring out PIC programming,a dn I have most of the logic already worked out. And while this would be fairly easy to replicate with dedicated logic gates, the PIC is just as cheap if not cheaper, and a single 18 pin chip handles it all. One PIC per staging track, although if I used a larger one with more pins I could use one PIC per yard.
The next step is to get an appropriate detector circuit built and hook it all up on a breadboard and get the code working.
--Randy
Modeling the Reading Railroad in the 1950's
Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.
Lee
Just past the turnout that makes 2 staging tracks is the turnout that connects the staging to the main (X staging design - see the full track plan). That part is visible. So as long as sensor 1 is clear, the train is clear and not blocking the turnout. Same deal with the space between trains. If S2 AND S3 are both blocked, that's a no-no - or only 1 train will fit on that track. The condition there would light the red LED for both halves, indicating no room for another train on that track.
Any other detection will involve signals, and use regualr current detection. Which is somethign I want to install at some point but the prototype did NOT have signals on this branch.
Lee 1234If S4 is lit you can't tell from the lights if the out bound switch is fouled.
Correct, it's a 2 track single ended staging yard. Immediately after the next turnout to the left (not shown, which connects the staging to the main) ther is another turnout leadign to another 2-track staging yard that faces the other way (I first saw it in an old Model Railroad Planning, it;s called X Staging - I didn't consider it initially but I was stuck on fitting staging in and posted my plan here and I think it was Stein suggested X staging, so obvious but I missed it).
Otherwise this continuous detection idea is overcomplicating things. You do NOT stop a train in the 'middle' of one of the halves - ie a train between S1 and S2 with neither covered, or a train between S3 and S4 with neither covered. No there's nothing that prevents that, but those are the rules, and the LEDs light accordingly. No stopping until the RED LED is on. ANd if the red LED is on for the front half of the track but the green is on for the rear half - keep moving untl the red LED comes on for the rear half.
I could theoretically automate this, then I'd need one more sensor at the start of the staging area and have to figure out how to get a JMRI script to take over control of whatever loco was there. Then the easy part, drive at slow speed until the proper LED lights (also then linked to the system through an I/O card like a LocoIO). The handoff from the system throttle to a JMRI RoboThrottle would be the hard part. Way overkill really, considering probably 90% of the time I will be operating the layout alone.
Website: http://bobfrey.auclair.com