Railroad train games by Rule the Rail - Home Train games, railway games Rule the Rail!

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Complex Controller Track

 
Post new topic   Reply to topic    Train games, railway games Rule the Rail! Forum Index -> Creating automatic controls
View previous topic :: View next topic  
Author Message
Chris



Joined: 10 Mar 2006
Posts: 644
Location: Wisconsin, USA

PostPosted: Mon Mar 05, 2007 4:59 pm    Post subject: Complex Controller Track Reply with quote

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.



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).


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.


3. Third Switch: The freight must obey block signalling on the mainline so it cannot enter an occupied block.


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
Back to top
View user's profile Send private message Send e-mail
austindave



Joined: 19 Feb 2006
Posts: 391
Location: UK

PostPosted: Mon Mar 05, 2007 5:13 pm    Post subject: Reply with quote

Hi Chris

Now thats got me scratching my head.

Dave
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Chris



Joined: 10 Mar 2006
Posts: 644
Location: Wisconsin, USA

PostPosted: Mon Mar 05, 2007 5:27 pm    Post subject: Reply with quote

Hi 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
Back to top
View user's profile Send private message Send e-mail
Map



Joined: 26 Dec 2006
Posts: 70

PostPosted: Mon Mar 05, 2007 11:12 pm    Post subject: Reply with quote

Hi 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
Back to top
View user's profile Send private message
Chris



Joined: 10 Mar 2006
Posts: 644
Location: Wisconsin, USA

PostPosted: Tue Mar 06, 2007 4:13 am    Post subject: Reply with quote

Hi 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
Back to top
View user's profile Send private message Send e-mail
peter



Joined: 08 Jul 2006
Posts: 581
Location: germany,Thuringia

PostPosted: Tue Mar 06, 2007 11:28 am    Post subject: Reply with quote

Hi 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 Idea Question Cool
_________________
for next time and thanx Peter
如 如 Nothing is impossible if we make it together.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
Map



Joined: 26 Dec 2006
Posts: 70

PostPosted: Tue Mar 06, 2007 10:55 pm    Post subject: Reply with quote

Hi 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
Back to top
View user's profile Send private message
Chris



Joined: 10 Mar 2006
Posts: 644
Location: Wisconsin, USA

PostPosted: Wed Mar 07, 2007 2:17 pm    Post subject: Reply with quote

Hi 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
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Train games, railway games Rule the Rail! Forum Index -> Creating automatic controls All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum