Trains.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Staging detection ideas

1244 views
6 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Staging detection ideas
Posted by rrinker on Tuesday, August 17, 2010 10:30 PM

 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.

  • Member since
    January 2007
  • 283 posts
Posted by Lee 1234 on Wednesday, August 18, 2010 1:16 PM
You need to sense that the end turnouts and the center gap between trains are clear. Otherwise you will still be looking behind the backdrop.

Lee

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Wednesday, August 18, 2010 3:36 PM

 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.

                               --Randy


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    January 2007
  • 283 posts
Posted by Lee 1234 on Wednesday, August 18, 2010 6:47 PM
If you have one train on a track you need to have S3 and/or S4 lit or the train will be lost. If S4 is lit you can't tell from the lights if the out bound switch is fouled. In the center, if S3 is lit and a second train is run in the track, once S2 s lit you can't tell if the trains are connected. Train 1 could end up dragging train 2. Think about it.

Lee

  • Member since
    February 2007
  • From: Christiana, TN
  • 2,134 posts
Posted by CSX Robert on Wednesday, August 18, 2010 7:41 PM
Lee 1234
If S4 is lit you can't tell from the lights if the out bound switch is fouled.
I don't believe there is an outbound switch(I think it is single ended staging).
  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Wednesday, August 18, 2010 8:24 PM

 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.

                                     --Randy


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    August 2006
  • From: Greendale, WI
  • 108 posts
Posted by Robert Frey on Wednesday, August 18, 2010 9:26 PM
Randy, Let each IR sensors operate directly a RED LED and a YELLOW LED in each block, as in your diagram. For a single ended staging track using 1, 2, or 3 trains, use the idea of: “STOP train on the last RED LED only!” A YELLOW LED on, you are only passing through. Then 1 RED is 1 Train, 2 REDs is 2 Trains and 3 REDs are 3 Trains in the siding. RED and YELLOW in the same block, is “The Train is too long.” No REDs, and no YELLOWs is: “The 3 train staging track is clear” Robert Frey Simple_IR_Sensor

Website: http://bobfrey.auclair.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Users Online

There are no community member online

Search the Community

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!