Home › Forums › Building layouts › Creating automatic controls › Complex Controller Track
- This topic has 7 replies, 4 voices, and was last updated 17 years, 8 months ago by Anonymous.
-
AuthorPosts
-
March 5, 2007 at 4:59 pm #170AnonymousInactive
Hi all, I thought I’d share some ideas I’ve had with a more complex version of controller tracks. I’ve been exploring ways of implementing a form of conditional ‘scripting’ that doesn’t appear as easily done in the linear ‘scripting’ I’ve used in the past. I’ll illustrate my thoughts with the examples shown below.
This first example shows two versions I’m working on.
[img]http://www.rtrfan.us//RTR/Technique/rtr_093528.jpg [/img] The first, the simple ‘Y’ in the left foreground, is a boolean pass-through which allows only one passenger train into the passenger siding at a time (based on engine ID). Each branch past the switch has a control that returns the engine back to the starting point (curve would be false) or opens the siding switch as well (straight would be true).
The second, middle foreground, is the controller track that controls when the train can safely leave the siding. The control engine is staged in front of the switch that is used for this function. The curve (false) contains the logic to return the engine back to the staging point as well as sets a timer to repeat the action. The straight (true) contains the logic to power the engine and set switches and blocks appropriately.
The first example is simpler because it is triggered by only one control on the mainline so the engine has sufficient time to return to the staging point without the switch being thrown beforehand. The second is more complex because there are a number of triggering controls on the mainline so it is possible that a switching accident could occur. This track structure permits the control engine to return to the staging point without reentering the switch.
The next example is more complex. It is used to control the reentry of a freight consist back onto the mainline. There are three conditions that must be met.
1. First switch: The freight must be staged correctly (at the end of the siding).
[img]http://www.rtrfan.us//RTR/Technique/rtr_093759.jpg [/img] 2. Second Switch: I’ve determined that passenger trains have priority over freights. Therefore, a freight cannot enter the mainline when a passenger train is approaching.
[img]http://www.rtrfan.us//RTR/Technique/rtr_094256.jpg [/img] 3. Third Switch: The freight must obey block signalling on the mainline so it cannot enter an occupied block.
[img]http://www.rtrfan.us//RTR/Technique/rtr_094316.jpg [/img] The control engine can be powered by three controls, two on the mainline and one on the siding. Passenger trains can ‘pull’ the freight onto the mainline while other freights can ‘push’ it onto the mainline.
In programming, this would be written as the following pseudocode:
IF
the engine is staged
AND
the preceding block does not contain a passenger train
AND
the mainline block to be entered is empty
THEN
do those actions that power the freight, properly power blocks, properly set switches
ELSE
restage the control engine
Since all conditions must be met before the freight can reenter the mainline, the control managing this is located just once following the third switch.
This controller track structure could also be used for a situation where any one of the conditions could power the freight.
In programming, this would be written as the following pseudocode:
IF
the engine is staged
OR
the preceding block does not contain a passenger train
OR
the mainline block to be entered is empty
THEN
do those actions that power the freight, properly power blocks, properly set switches
ELSE
restage the control engine
In that case, an instance of the control powering up the freight would be located on the curve side of each of the three switches.
The next step would be to add cut-outs to prevent the controller engine from entering a switch incorrectly – a switch cannot be ‘thrown’ once the controller engine is powered up.
I’d love to hear any ideas that would help me improve on this.
Regards, Chris
March 5, 2007 at 5:13 pm #1824AnonymousInactiveHi Chris Now thats got me scratching my head.
Dave
March 5, 2007 at 5:27 pm #1825AnonymousInactiveHi Dave, I’ve sent the latest ‘draft’ version of the layout to you through e-mail. I’d be happy to discuss the nuts and bolts of it with you once you’ve seen it in operation.
Regards, Chris
March 5, 2007 at 11:12 pm #1826AnonymousInactiveHi Chris, I can’t tell wether you’ve had lots of experience programming in BASIC
or program PLCs or both or neither! I can, however, tell that Thats a pretty impressive application of controll logic! Boolean Algebra.Wow,
Could it be from solid state circuit design?
Also, those are pretty snappy looking stations you have there.
Nice going!!!
Mark
March 6, 2007 at 4:13 am #1827AnonymousInactiveHi Mark, Thanks for your comments. I’ve worked as a software engineer for a number of years.
I’ll do my best on modelling a station based on those examples. Brainbom is over-commited at this point so I can’t give you any idea when it might be introduced into the game.
Best regards, Chris
March 6, 2007 at 11:28 am #1828AnonymousInactiveHi Map,Chris and Dave, It´s not only in BASIC on pc,the sps is the same. And Chris is creating a sps with these tracks. See what brainbom says to this pics and explantation.
may be bb will implement a ec as tiny BASIC
💡 : March 6, 2007 at 10:55 pm #1829AnonymousInactiveHi Chris, No hurry on the stations. I’ve seen your work and know that it is worth waiting for. I’m just having fun posting pictures. If they can be of any use to someone, so much the better! As I said, if there is anything up at this end of the country that you’d like to model and need a picture of, let me know.
As for the controll, have you considered developing a flowchart & logic/truth table for planning a control point. If predetermined control sets for specific movements could each be assigned a “command” each compex routine would only need to be worked out once and then individual “commands” could be linked into a program of sorts.
But my guess would be that You’ve allready been there!
Thanks and have fun…
Mark
March 7, 2007 at 2:17 pm #1830AnonymousInactiveHi Mark, Formalizing it as you’ve suggested would ease layout modification/expansion not to mention making it clearer to someone seeing the operation for the first time. Right now there are about 21 blocks on the mainline (a block is about the length of the longest train on the layout). Since each train modifies the three trailing blocks – off, a percentage of the ‘legal’ limit, and the ‘legal’ limit – I should be able to have seven trains operating on the main line at any one time with a train waiting in each siding.
There’s a certain randomness to the operation – adding or removing freights and passenger trains seem to change whatever pattern establishes itself. That randomness is something I’m going for since it helps maintain my interest.
I’ve left myself some expandability as well. I’ve thought of putting in an interchange that would lead into a local short line for switching operations.
Thanks for your suggestions.
Best regards, Chris
-
AuthorPosts
- You must be logged in to reply to this topic.