Welcome to the forum   
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
View
Go to last post in this topic Go to first unread post in this topic
Offline French_Fabrice  
#1 Posted : 27 February 2013 23:24:02(UTC)
French_Fabrice

France   
Joined: 16/05/2011(UTC)
Posts: 1,287
Location: Lyon, France
Hello Märklin & Rocrail fans,

I'd like to share with you an example of complex « actions » (sometimes conditional), which are currently driving my railroad crossings.
This article will be posted in 3 parts, due to post restriction size.

PART1

1 Preamble

This note is a complement/deeper example to http://wiki.rocrail.net/...hp?id=level_crossing_en. This link already describes how to setup a railroad crossing using outputs, sensors and actions.

It is recommended, if you are not aware of « actions » and wish to go further, to fully read before the wiki about actions and the examples already provided.

Please note the following : « Try when you design a layout to apply what is already described in the link.  It's the most simple. Unhappily, there are some cases where you can't avoid some complexity, so this example tries to illustrate some ways to manage it (and it is certainly far from perfect !) »

Please also note this topic may be difficult to understand if you don't already have an experience with Rocrail, especially with « blocks », « routes », « outputs » and basic « actions ».

2 Introduction

In my case, I had many constraints (maybe due to lack of design...Blushing )
  • the sensors weren't put on the tracks in the right place, and dismantling the layout wasn't an option. ThumbDown
  • the traffic involved by my two railroad crossings is bi-directional Cursing
  • one of the railroad crossing is set between 2 tracks, the second one has only one track Crying
  • all railroad crossings are complemented by 4 X St Andrew crosses Huh
  • the already in place sensors were either too close to railroad crossings, or simply missing to provide realistic closure/opening of the barriers ThumbDown

...but with luck
  • many automated blocks were already in place and gave satisfactory behavior ThumpUp


So the idea to drive « actions » is to use events related to blocks occupancy, and if not enough, use events related to routes triggering, and sometimes events related to signals. The occurrence of events depends on the « state » of each block and/or route and/or signals involved.
These events are called in the Rocrail documentation « action controls ».

That is what I mean by using complex actions.

Here is an extract of my Rocrail synoptic:
UserPostedImage

3 Setup
3.1 Hardware used
  • 2 sets of railroad crossings (Viessmann 5100)
  • 2 sets of 4 St Andrew crosses (Viessmann 5835)
  • 1 K83 (or compatible)
  • 1 K84 (or compatible)

3.2 Railroad crossing 1 (double track - down-left angle)
  • addresses 61 & 62 (one address for each barrier), driven by half a K83. Setup in Rocrail is done by switches (Gate61 & Gate62), with a type of Accessory, and Accessory picture #11 (single barrier)
  • set of St Andrew crosses, address 137, driven by 1/4 K84. Setup in Rocrail is done by an « Output » object (k137)

3.3 Railroad crossing 2 (single track - middle on the left)
  • addresses 63 & 64 (one address for each barrier), driven by the remaining half of the K83. Setup in Rocrail is done by switches (Gate63 & Gate64), with a type of Accessory, and Accessory picture #11 (single barrier)
  • set of St Andrew crosses, address 138, driven by 1/4 K84. Setup in Rocrail is done by an « Output » object (k138)

...A picture of the real life...
UserPostedImage
bottom of image is Railroad crossing 1, top of image is Railroad crossing 2

4 Traffic
Note: Please look at the green arrows in the synoptic. They describe the traffic direction allowed in each block.

4.1 Traffic involved for Railroad crossing 1 (medium complexity) Crying
Note: Sidings blocks are currently not included in the traffic.

4.1.1 Single direction track
  • From BFront1 then BFront2 to BDown1
  • From BFront1 then BFront2 to BRear1
  • From BFront1 then BFront2 to BRear2

4.1.2 Bi-directional track
  • From BFront3 to BDown1
  • From BFront3 to BRear1
  • From BFront3 to BRear2
  • From BRear1 to BFront3
  • From BRear2 to BFront3

Note: BFront2 is a short block

4.2 Traffic involved for Railroad crossing 2 (higher complexity...All bi-directional !) Cursing
Note: Sidings blocks are currently not included in the traffic.

4.2.1 From left to right
  • From BRear1 to BStation2
  • From BRear1 to BStation3
  • From BRear2 to BStation2
  • From BRear2 to BStation3

4.2.2 From right to left
  • From BStation1 to BDown1
  • From BStation1 to BRear1
  • From BStation1 to BRear2
  • From BStation2 to BDown1
  • From BStation2 to BRear1
  • From BStation2 to BRear2

5 Definition of « Actions »
This section describes how to define the « actions ».
UserPostedImage

Definition of Action « StAndrew137Active »

UserPostedImage

Definition of Action « StAndrew138Active »

UserPostedImage

Definition of Action «closeGate61»

UserPostedImage

Definition of Action «closeGate62»

UserPostedImage

Definition of Action «closeGate63»

UserPostedImage

Definition of Action «closeGate64»

UserPostedImage

Definition of Action « StAndrew137Inactive »

UserPostedImage

Definition of Action « StAndrew138Inactive »

UserPostedImage

Definition of Action «openGate61»

UserPostedImage

Definition of Action «openGate62»

UserPostedImage

Definition of Action «openGate63»

UserPostedImage

Definition of Action «openGate64»

END OF PART1
The second part will follow soon...

Cheers
Fabrice

Edited by user 18 June 2014 17:35:11(UTC)  | Reason: re-uploaded pictures

thanks 3 users liked this useful post by French_Fabrice
Offline Nielsenr  
#2 Posted : 28 February 2013 20:54:22(UTC)
Nielsenr

United States   
Joined: 06/10/2010(UTC)
Posts: 882
Location: Fort Lauderdale, FL
Fabrice,

Thanks for the detail on this. Looking forward to part 2. I know you have put a lot of effort into this. I haven't played with Rocrail for a number of months now, but if you do alternating trains on station sidings, I would like to see a tutorial on it. I tried playing with alternating trains but ran into difficulties.

Thanks again!!

Robert
Offline French_Fabrice  
#3 Posted : 28 February 2013 21:07:25(UTC)
French_Fabrice

France   
Joined: 16/05/2011(UTC)
Posts: 1,287
Location: Lyon, France
PART2

6 Action controls which trigger the actions

This section describes how to implement the action controls.
Please note these action controls are NOT defined inside the « actions » sub-menu. They are defined in the source objects (which generate the triggering events) i.e. the blocks, routes and signals.

6.1 Requirements for traffic described in section 4.1.1
  • Req 1-1: When a loco leaves BFront1 towards BFront2, Gates 61 & 62 must be closed and StAndrew137 must be active (blinking red lights) (easySmile )
  • Req 1-2: When the block BFront2 is freed, Gates 61 & 62 must be opened and StAndrew137 must be inactive (no more blinking red lights) (less easySneaky)

6.2 Implementation
6.2.1 Req 1-1
Action control on block BFront1 :
UserPostedImage

Click on the « Actions... » button of Block BFront1

UserPostedImage

State « occupied » of BFront1 driving action « closeGate61 »

UserPostedImage

State « occupied » of BFront1 driving action « closeGate62 »

UserPostedImage

State « occupied » of BFront1 driving action «StAndrew137Active»

6.2.2 Req 1-2
Action control on Block BFront2 :
UserPostedImage

Click on the « Actions... » button of Block BFront2

UserPostedImage

State «free» of BFront2 driving action «openGate61»

UserPostedImage

State «free» of BFront2 driving action «openGate61»

UserPostedImage

State «free» of BFront2 driving action «StAndrew137Inactive»



Problem : If blocks BFront1 and BFront2 are both occupied and trains are stopped because of each waiting for a free destination, Req 1-1 implies Gate61 & 62 are closed.
Now, if a train leaves BFront2 and frees that block, Req 1-2 implies Gate61 & 62 are opened ;
BUT if the train in BFront1 has not entered yet BFront2, then the gates won't be closed !
-> some supplementary requirement is needed (see Req 1-3)

6.3 Supplementary requirement
  • Req 1-3: When the block BFront2 is entered, Gates 61 & 62 must be closed and StAndrew137 must be active (blinking red lights)

6.4 Implementation of Req 1-3
Action control on Block BFront2 :
UserPostedImage

State «enter» of BFront2 driving action « closeGate61 »

UserPostedImage

State «enter» of BFront2 driving action « closeGate62 »

UserPostedImage

State «enter» of BFront2 driving action «StAndrew137Active»


Question: « Why not only use Req 1-3 instead of Req 1-1 ? »
Answer: « Because if a train doesn't stop in BFront1, the trigger on "entering" BFront2 is a bit late compared to the time necessary for the loco speed to decrease/time necessary for the barriers to go down. When the loco is starting from BFront1, the delay is more acceptable ».

In summary, the primary event for closing the barriers is « BFront1 occupied » and the secondary/security event is « BFront2 entered ».

6.5 Requirements for traffic described in section 4.1.2
  • Req 1-4: When the block BFront3 is entered from right to left, Gates 61 & 62 must be closed and StAndrew137 must be active (blinking red lights) ...easy Smile  !
  • Req 1-5: When the block BFront3 is freed (from any direction), Gates 61 & 62 must be opened and StAndrew137 must be inactive (no more blinking red lights) ...easy Smile !

6.6 Implementation of Req 1-4 and 1-5
Action control on Block BFront3 :
UserPostedImage

Click on the « Actions... » button of Block BFront3

UserPostedImage

State «enter» of BFront3 driving action «closeGate61»

UserPostedImage

State «enter» of BFront3 driving action «closeGate62»

UserPostedImage

State «enter» of BFront3 driving action «StAndrew137Active»

UserPostedImage

State «free» of BFront3 driving action «openGate61»

UserPostedImage

State «free» of BFront3 driving action «openGate62»

UserPostedImage

State «free» of BFront3 driving action «StAndrew137Inactive»


6.7 Requirements for traffic described in section 4.1.2 (cont.)
  • Req 1-6: The sensor r1-11 is too close to barriers, so the event related to this sensor can't be used when a loco enters the block BFront3 from left to right (less easy Sneaky ). This requirement can be translated in the following two requirements :
    • Req 1-6-1: When the route BRear1->BFront3 is set, Gates 61 & 62 must be closed and StAndrew137 must be active (blinking red lights)
    • Req 1-6-2: When the route BRear2->BFront3 is set, Gates 61 & 62 must be closed and StAndrew137 must be active (blinking red lights)

6.8 Implementation of Req 1-6-1 and 1-6-2
Action control on Routes :

6.8.1 Route BRear1->BFront3
UserPostedImage

Click on the « Actions... » button of Route

UserPostedImage

State «lock» of Route driving action «closeGate61»

UserPostedImage

State «lock» of Route driving action «closeGate62»

UserPostedImage

State «lock» of Route driving action «StAndrew137Active»

6.8.2 Route BRear2->BFront3
UserPostedImage

Click on the « Actions... » button of Route

UserPostedImage

State «lock» of Route driving action «closeGate61»

UserPostedImage

State «lock» of Route driving action «closeGate62»

UserPostedImage

State «lock» of Route driving action «StAndrew137Active»


This ends the implementation of the Railroad crossing #1 (medium complexity).OhMyGod
END OF PART2

...Part3 is coming...Hold on
Cheers
fabrice

Edited by user 18 June 2014 18:03:04(UTC)  | Reason: re-uploaded pictures

thanks 1 user liked this useful post by French_Fabrice
Offline French_Fabrice  
#4 Posted : 28 February 2013 22:22:32(UTC)
French_Fabrice

France   
Joined: 16/05/2011(UTC)
Posts: 1,287
Location: Lyon, France
PART3

6.9 Requirements for traffic described in section 4.2.1 (higher complexity)Scared
  • Req 1-7: When a loco leaves BRear1 towards BStation2, Gates 63 & 64 must be closed and StAndrew138 must be active (blinking red lights)
  • Req 1-8: When a loco leaves BRear1 towards BStation3, Gates 63 & 64 must be closed and StAndrew138 must be active (blinking red lights)
  • Req 1-9: When a loco leaves BRear2 towards BStation2, Gates 63 & 64 must be closed and StAndrew138 must be active (blinking red lights)
  • Req 1-10: When a loco leaves BRear2 towards BStation3, Gates 63 & 64 must be closed and StAndrew138 must be active (blinking red lights)
  • Req 1-11: When a loco is reaching the end of block BStation3, Gates 63 & 64 must be opened and StAndrew138 must be inactive (no more blinking red lights)
  • Req 1-12: When a loco is coming from left to right and reaches the end of block BStation2, Gates 63 & 64 must be opened and StAndrew138 must be inactive (no more blinking red lights)


6.10 Implementation of Req 1-7 to Req 1-12
Action controls on routes for Req 1-7 to Req 1-10, and Action controls on blocks for Req 1-11 & Req 1-12.

6.10.1 Route BRear1->BStation2
UserPostedImage

Click on the « Actions... » button of Route

UserPostedImage

State «lock» of Route driving action «StAndrew138Active»

UserPostedImage

State «lock» of Route driving action «closeGate63»

UserPostedImage

State «lock» of Route driving action «closeGate64»


6.10.2 Route BRear1->BStation3
Repeat the 4 previous images. Substitute the route name in the 1st image. The next 3 images are identical.

6.10.3 Route BRear2->BStation2
Repeat the 4 previous images. Substitute the route name in the 1st image. The next 3 images are identical.

6.10.4 Route BRear2->BStation3
Repeat the 4 previous images. Substitute the route name in the 1st image. The next 3 images are identical.

6.10.5 Block BStation3
UserPostedImage

Click on the « Actions... » button of Block

UserPostedImage

State «occupied» of Block driving action «StAndrew138Inactive»

UserPostedImage

State «occupied» of Block driving action «openGate64»

UserPostedImage

State «occupied» of Block driving action «openGate63»


6.10.6 Block BStation2
Repeat the 4 previous images. Substitute the Block name in the 1st image. The next 3 images are identical.

6.11 Requirements for traffic described in section 4.2.2
  • Req 1-13: When a loco leaves BStation1, Gates 63 and 64 must be closed and StAndrew138 must be active (blinking red lights)
  • Req 1-14: When a loco leaves BStation2 towards the left, Gates 63 and 64 must be closed and StAndrew138 must be active (blinking red lights)


6.12 Implementation of Req 1-13 & Req 1-14
These requirements are implemented thru action control on signals, instead of routes. This reduces the amount of combinations (2 signals instead of 6 routes)Woot .
  • S401 is signal associated to block BStation1. It's a 4 aspect signal.
  • S403 is signal associated to block BStation2 on left handside. It's a 4 aspect signal.


6.12.1 S401
UserPostedImage

Click on the « Actions... » button of Signal

UserPostedImage

State «white» of Signal driving action «StAndrew138Active»

UserPostedImage

State «white» of Signal driving action «closeGate63»

UserPostedImage

State «white» of Signal driving action «closeGate64»


6.12.2 S403
Repeat the 4 previous images ; substitute s401 by s403 in the 1st one ; the next 3 are identical.


Question : « When a train leaves from right to left either BStation1 or BStation2, OK the barriers go down when the signal goes white ; but the barriers never go up after the train has passed the railroad crossing » ?
Answer : « For the barriers to go up, both signals must be 'red' ». This is Req 1-15.
Question : « Why both signals must be red » ?
Answer : « This logic guarantees that no train is running from right to left, so the barriers can be opened ».

6.13 Requirements for traffic described in section 4.2.2 (cont.)
  • Req 1-15 : For opening the Gate63 and 64, and disabling StAndrew138, s401 must be 'red' AND s403 must be 'red'


6.14 Implementation of Req 1-15
Action control on signals, complemented with a condition on each action control. Cursing Confused

6.14.1 S401
UserPostedImage

State «red» of Signal s401 driving action «StAndrew138Inactive»

UserPostedImage

Condition associated to the action control

UserPostedImage

State «red» of Signal s401 driving action «openGate63»

UserPostedImage

Condition associated to the action control

UserPostedImage

State «red» of Signal s401 driving action «openGate64»

UserPostedImage

Condition associated to the action control


6.14.2 S403
Repeat the 6 previous images ; swap in the legend s401 by s403 ; swap in the images s403 by s401.

This end the implementation of Railroad crossing #2 (higher complexity). OhMyGod OhMyGod OhMyGod

7 Lab
… Include now the sidings in the traffic … Blink Blink Blink

END OF PART3

Have fun !

Cheers
fabrice

Edited by user 18 June 2014 18:20:46(UTC)  | Reason: re-uploaded pictures

Offline French_Fabrice  
#5 Posted : 01 March 2013 19:27:52(UTC)
French_Fabrice

France   
Joined: 16/05/2011(UTC)
Posts: 1,287
Location: Lyon, France
Originally Posted by: Nielsenr Go to Quoted Post
Fabrice,

Thanks for the detail on this. Looking forward to part 2. I know you have put a lot of effort into this. I haven't played with Rocrail for a number of months now, but if you do alternating trains on station sidings, I would like to see a tutorial on it. I tried playing with alternating trains but ran into difficulties.

Thanks again!!

Robert


Hi Robert,

Thanks for your appreciation on this article.

About your question, I'm not sure to fully understand it. Do you mean:
  1. How to mix traffic running in automatic mode on the main tracks, and manual mode on the sidings ?
  2. Manage automatic random mode on the main tracks ?
  3. other ?


If it's about point #1, I don't have a full answer, only clues (allow sidings blocks to have "ghost" trains is the beginning of the process...). That's my next topic to study.Huh . Otherwise, please provide me more details...

Cheers
fabrice
Offline Nielsenr  
#6 Posted : 04 March 2013 07:13:19(UTC)
Nielsenr

United States   
Joined: 06/10/2010(UTC)
Posts: 882
Location: Fort Lauderdale, FL
Fabrice,

I was thinking of a multiple track station or hidden yard. Say X number of tracks with X-1 tracks occupied (or maybe less). A train comes into the open track, sets off one of the other locos (random or sequentially). The next train comes into where that train left and etc, etc. I can do it through routes on the CS2 but I had a hard time getting Rocrail to do it. I guess I need to learn Rocrail better.

Robert
Offline French_Fabrice  
#7 Posted : 04 March 2013 08:26:04(UTC)
French_Fabrice

France   
Joined: 16/05/2011(UTC)
Posts: 1,287
Location: Lyon, France
Originally Posted by: Nielsenr Go to Quoted Post
Fabrice,

I was thinking of a multiple track station or hidden yard. Say X number of tracks with X-1 tracks occupied (or maybe less). A train comes into the open track, sets off one of the other locos (random or sequentially). The next train comes into where that train left and etc, etc. I can do it through routes on the CS2 but I had a hard time getting Rocrail to do it. I guess I need to learn Rocrail better.

Robert


Hello Robert,
I think the feature you're looking for is called in Rocrail "locations".
http://wiki.rocrail.net/....php?id=locations-def-en

Playing with 'minimal occupancy' and 'flow management' gives good results. I've implemented it in my two hidden stations. Runs fine.

Cheers
Fabrice
Offline Nielsenr  
#8 Posted : 04 March 2013 08:36:43(UTC)
Nielsenr

United States   
Joined: 06/10/2010(UTC)
Posts: 882
Location: Fort Lauderdale, FL
Thanks Fabrice!!

I'll look into "locations".

Robert
Offline French_Fabrice  
#9 Posted : 18 June 2014 18:28:12(UTC)
French_Fabrice

France   
Joined: 16/05/2011(UTC)
Posts: 1,287
Location: Lyon, France
Hi,
I've reloaded all the pictures today, as they vanished from the host.
I hope having put them back in the right order.

I also provide as an attachment a pdf file containing the 3 parts of this article.

Cheers
fabrice

File Attachment(s):
ca.pdf (2,739kb) downloaded 28 time(s).
thanks 1 user liked this useful post by French_Fabrice
Users browsing this topic
OceanSpiders 2.0
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

| Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.727 seconds.