Any ideas for detecting direction of travel and Block occupancy?

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
I wonder if anyone can help me with ideas, or links to circuits.

A friend has just installed a long single line section where it is difficult to see the whole line. He asked if I could figure some electronic circuit to add 'signals' at either end to show if there is a train in the section. They don't have to be 'real signals' with absolute fail safe operation – just a visual aid.
All trains are battery powered, the rails cannot be guaranteed to be electrically continuous so the simple block relay idea is out. We don't want to modify locos in any way.
I use infra-red train detectors on my layout so I can use these, but trying to determine the direction of travel is a bit more difficult.

Dave Bodnar's site is my 'bible' for circuit ideas. http://www.trainelectronics.com/
But I cannot find any ideas for direction detection.
His idea of using lasers along the track, rather than across, looks promising http://trainelectronics.com/Laser_Train_Detection/index.htm
But not easy in my instance as there are curves.

I'm wondering if two infra-red detectors placed close together – less than the shortest loco apart – could be used. The order in which is detects a loco could be determined. There would be a pair at each end of the single line.

Can anyone help with any ideas?

And of course there is the added problem of the impossibility of getting wiring between the two ends of the single line due to concrete path in the way. So I'll be experimenting with radio too.
 

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
Staff member
GSC Moderator
25 Oct 2009
26,247
5,001
75
St.Neots Cambridgeshire UK
Best answers
0
Country flag
On the Ruschbahn we used Micro Switches to initiate a Relay. The switch was activated by the Wheel Flange being mounted just below the Rail Head. This was OK and simple on a set of Fiddle Sidings that were one way directional.

But it can get awfully complex where Traffic has to go both ways.

For each direction you need an activating switch that locks the relay to that direction freeing it with another switch at the other end I would imagine.

Any Rush wanted to have a Block Ocupation system in advance of what he had already created for some Single Line Sections on his line. But he decided that it was awfully complex to arrange and he was an ex Signals and Telegraph Engineer!

Perhaps a Token System as I have used on my line might be an easier option.
 

ge_rik

British narrow gauge (esp. Southwold and W&LLR)
24 Oct 2009
10,709
1,245
Cheshire
www.riksrailway.blogspot.com
Best answers
0
Country flag
Hmmmmm...... just let me get my head around this.

There's a section of track, say between A and B

< -------- A -------------------------------- B ------------->

So, if a train enters at A you don't want another train to enter at B, and maybe don't want another train to enter at A until the train has cleared B.

Similarly if a train enters at B .......

If you have sensors at A and B, couldn't it be controlled with a couple of simple logic circuits?

If A is tripped and B has not then the train at A is safe to proceed to B. However, if B has already been tripped then, when A is tripped, a red light is shown - do not proceed! The red light remains until the train which tripped B clears A.

Hmmmmm.... I see the problem. For A to be tripped, the train would have to have already entered the section. So, how about if the trips were on loops before the single line section? Would that work?
a B
------<======>----------------------------<========>------------
A b
Hmmmm.... It's getting more complicated.

So, a train trips A and gives a red light until it clears b. A train trips B and gives a different red light until it clears a.

Would that work, or am I missing the bleedin' obvious?

Rik

PS EDIT. The system strips out the spaces, the a and B are supposed to be above each of the loops and the A and b are positioned below each loop.
 

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
33,663
3,536
Nottingham
Best answers
0
Country flag
A 'treadle', or two detectors in series will give direction..
A (fairly) simple bit of logic will give you a 'go' 'no-go' output, then you will need to get the information to the other end..

Do you just want a 'do not enter' red light, or to actually isolate a section to stop a loco entering from the other end? - Problems with the later, being complexity, and people get to rely on it.

You would need a way to set an initial condition, and visually check it was so, at the start..
I would probably have two-aspect lights for each end at each end:
Start: Line clear, all aspects green, both ends.
Train enters A-end, far-end local signal shows red (no entry) - Train from A proceeds with caution.
When train clears the section it would be detected and reset the signal to green.
Same in reverse for a train starting from B-end.
If one train has entered the section, and then a train enters from the other end, both signals at each end would show red. - Double-red means both stop, and walk the section to decide who will back-up.

Of course, if you want a second train to follow the first, from the same end, then the logic becomes a little trickier!
 

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
Staff member
GSC Moderator
25 Oct 2009
26,247
5,001
75
St.Neots Cambridgeshire UK
Best answers
0
Country flag
Of course, if you want a second train to follow the first, from the same end, then the logic becomes a little trickier!
Phil, I think Andy sort of went through all of the Logic that has been said thus far and at the thought of the above started to go blub blub blub!
 

minimans

Trains, Planes, Automobiles & Shooting
24 Oct 2009
6,593
222
67
San Francisco Bay Area
Best answers
0
CCTV Camera?
 

Gavin Sowry

Garden Railroader and Raconteur
27 Oct 2009
7,843
2,490
70
Hutt Valley, NZ
Best answers
0
Country flag
In conjunction with one of my return loops (track powered), I have signal 'controlling entry back into the single line'. Essentially, this is to ensure that the 'main line' has the polarity correctly set. I used a couple of diodes connected up to a signal.... if it shows red, the track has the wrong polarity (i.e. it will short when the train tries to enter the block. Green will indicate that the track is set, and live. the signal runs off the track power. Dark signal indicates no power.

That takes care of direction. Occupancy is up to you (and this forum) to figure out.
 

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
Thanks for your contributions. There's lots there to keep my brain ticking over.

On the Ruschbahn we used Micro Switches to initiate a Relay. The switch was activated by the Wheel Flange being mounted just below the Rail Head. This was OK and simple on a set of Fiddle Sidings that were one way directional.
An interesting idea - I will do some experiments to see if it works or if the wagons are derailed by the paddle.. I assume you mean those switches with a silver 'paddle'? But I doubt that they are waterproof.

In conjunction with one of my return loops (track powered), I have signal 'controlling entry back into the single line'. Essentially, this is to ensure that the 'main line' has the polarity correctly set. I used a couple of diodes connected up to a signal.... if it shows red, the track has the wrong polarity (i.e. it will short when the train tries to enter the block. Green will indicate that the track is set, and live. the signal runs off the track power. Dark signal indicates no power.That takes care of direction. Occupancy is up to you (and this forum) to figure out.

I used that system in the past, but no track power here, just battery.

As PhilP says, the 2nd difficulty after detecting direction, is to allow 2 trains to follow one another. I have no ideas on the solution for that.

Now to try and digest Rik's ideas too.
 

Gavin Sowry

Garden Railroader and Raconteur
27 Oct 2009
7,843
2,490
70
Hutt Valley, NZ
Best answers
0
Country flag
Search out Axle Counter signalling systems.... work on the principal that the block is clear, so a train can enter from any end. Sensor at one end counts the number of axles 'in', and another counts them 'out'. The one counting them in can be used to register direction. We use the system on very high frequency electrified suburban lines over here, as well as on long CTC blocks...... no track circuit required.
 

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
Search out Axle Counter signalling systems.... work on the principal that the block is clear, so a train can enter from any end. Sensor at one end counts the number of axles 'in', and another counts them 'out'. The one counting them in can be used to register direction. We use the system on very high frequency electrified suburban lines over here, as well as on long CTC blocks...... no track circuit required.
It's another possibility I suppose. I think the prototype uses magnetic detectors. I'm not sure how I could optically count the axles in a bogie where the gap between the wheels is only 20mm or so. To detect a single wheel, the optical transmitter or detector would have to be above rail head, between the rails - not a good idea. [ later thought... maybe the 'between rail Tx' could be below rail and the beam point upwards slightly to just clear the railhead..]
Maybe if I could get dunnyrail's micro switches to be operated by the flanges AND make them weatherproof, this would be a simpler method.
And how does the one counting them in know it is counting them in and not out, if one train follows another? Maybe the logic is simple if I think about it some more.:)
 
Last edited:

Gavin Sowry

Garden Railroader and Raconteur
27 Oct 2009
7,843
2,490
70
Hutt Valley, NZ
Best answers
0
Country flag
And how does the one counting them in know it is counting them in and not out, if one train follows another? Maybe the logic is simple if I think about it some more.:)

They are linked. They talk to each other (but I don't understand their language).
 

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
Staff member
GSC Moderator
25 Oct 2009
26,247
5,001
75
St.Neots Cambridgeshire UK
Best answers
0
Country flag
Greg,
These are the beasts I was thinking of

https://www.maplin.co.uk/p/miniature-microswitch-with-lever-n96aq

Though not waterproof per say they do last a long time outside, I use them to make all of my Peco Points live frog polarity work after conversion. Some have had an outside life in excess of 15 Years. We had them activating Relays on the Ruschbahn for a few years and the Spring on them is so light that Stock is not derailed. Tricky part is mounting them in the correct place for activating them. I found when replacing one that the best bet was to lengthen the Arm by wrapping some very fine Nickel Silver round the Arm. This made the activation even easier. You can also get them as Push to Make or Push to Break which has many uses I.E Break holding a Relay till switch is activated. On the Ruschbahn we used them to Acitivate an occupation Light. Signals would not be a very long change from this simple function, though there was a lot of wiring that I fail to understand the ise of! The Box used on the Ruschbahn with all its wiring and Micro Switches sits in my Loft since the demise of the Ruschbahn. I have never found a need for it sadly.
 

GAP

G Scale Trains, HO Trains, 1:1 Sugar Cane trains
14 Jun 2011
4,063
947
Bundaberg Queensland, Australia
Country
Australia
ringbalin-light-railway.blogspot.com
Best answers
0
Country flag
To add to PhilP’s suggestion

Control by 2 PICAXE

At power on set all lights to green (suggested)

Use 2 IR detector beams at each end (beam A and beam B) see Dave Bodnars site for inspiration http://www.trainelectronics.com/IR_Train_Detector_5-2007/index.htm

Train approaches and cuts beam A or B depending on travel direction (AND function ie 1st then 2nd = valid output)

On sensing a valid output Picaxe then changes light at exit end to red and leaves entrance green

Picaxe loops till entrance end no longer shows train present and sets entrance light to red leaving exit red

At exit end Picaxe loops till detectors no longer shows train present and after a pause the lights reset to all green waiting for next input. This should give separation of at least the single track length for trains travelling in same direction.

Because of battery power being used its then up to operators to sort out priority (alternate travel; bit like the day you suggested I ran your railmotor in the opposite direction to all traffic on a GRASS day and we had to sort out passing).

To control the lights over the distance use 433MHz keyfod transmitter (TX)/receivers (RX).

When Picaxe changes light at entrance end it also operates a button on TX (via transistor to pull low or high depending on how buttons work) to send a command to another RX/Picaxe at exit to set lights to red, for opposite direction reverse instructions.

Hardware would probably have to be duplicated ie 2 TX, 2 RX and 2 Picaxe.

I have been looking at something similar for crossing lights and boom gates without the radio gear.

For power supply look in $2 shops for solar light strings, the ones I have use 4 NiCd batteries so 5V for picaxe and TX/RX is available.

I have the idea in my head but am have trouble putting it into words and it may need a lot of finessing to get it to suit all situations but that should give your grey matter something to ponder.
 

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
Greg,
These are the beasts I was thinking of
https://www.maplin.co.uk/p/miniature-microswitch-with-lever-n96aq
Though not waterproof per say they do last a long time outside, I use them to make all of my Peco Points live frog polarity work after conversion. Some have had an outside life in excess of 15 Years. We had them activating Relays on the Ruschbahn for a few years and the Spring on them is so light that Stock is not derailed. Tricky part is mounting them in the correct place for activating them. I found when replacing one that the best bet was to lengthen the Arm by wrapping some very fine Nickel Silver round the Arm. This made the activation even easier.
I would also think that extending the arm as you suggest would have made it harder to operate. A longer arm would need a longer movement to give the same movement to the switch button Wouldn't it?
I have found a couple in my parts box to try tomorrow. The small one with the roller wheel should fit, but the other one is a bit big. (cm grid in pics)
IMG_7351.JPG
IMG_7352.JPG
 

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
You're close to the way I was thinking! see my red comments....
To add to PhilP’s suggestion

Control by 2 PICAXE at each end - one to detect & do the logic & drive local signals, and one for serial radio to/from other end. I'm not sure the picaxe can do the scanning of the 2 detectors and logic, within the approx 20ms I need.

At power on set all lights to green (suggested)

Use 2 IR detector beams at each end (beam A and beam B) see Dave Bodnars site for inspiration http://www.trainelectronics.com/IR_Train_Detector_5-2007/index.htm

Train approaches and cuts beam A or B depending on travel direction (AND function ie 1st then 2nd = valid output)

On sensing a valid output Picaxe then changes light at exit end to red and leaves entrance green

Picaxe loops till entrance end no longer shows train present and sets entrance light to red leaving exit red. Not necessary

At exit end Picaxe detectors can detect when end of train leaves section, then resets the red signal at that end AND the other end, to green. If at train shunts into a section and then reverses out at the same end, this logic will still work.
loops till detectors no longer shows train present and after a pause the lights resets to all green waiting for next input. This should give separation of at least the single track length for trains travelling in same direction.

Because of battery power being used its then up to operators to sort out priority (alternate travel; bit like the day you suggested I ran your railmotor in the opposite direction to all traffic on a GRASS day and we had to sort out passing).

To control the lights over the distance use 433MHz keyfod transmitter (TX)/receivers (RX).

When Picaxe changes light at entrance end it also operates a button on TX (via transistor to pull low or high depending on how buttons work) to send a command to another RX/Picaxe at exit to set lights to red, for opposite direction reverse instructions.
I'd consider using these....
https://www.ebay.com.au/i/112460107171?chn=ps&dispctrl=1

Hardware would probably have to be duplicated ie 2 TX, 2 RX and 2 Picaxe.

I have been looking at something similar for crossing lights and boom gates without the radio gear.

For power supply look in $2 shops for solar light strings, the ones I have use 4 NiCd batteries so 5V for picaxe and TX/RX is available.

I have the idea in my head but am have trouble putting it into words and it may need a lot of finessing to get it to suit all situations but that should give your grey matter something to ponder.
 

Neil Robinson

Registered
24 Oct 2009
9,699
579
N W Leicestershire
Best answers
0
Country flag
Would copying old prototype practice help?
If a section was clear the appropriate token could be removed. In the case of a garden railway there may be only one token per section removing the complication of ensuring only one token may be withdrawn at a time.
Once withdrawn the token was inserted and then removed from a device that cleared the starting signal for the appropriate section. A treadle on the track just beyond the starter reset the signal to danger as the train passed.
A model token may possibly be a jack plug, they are available in different diameters and configurations, e.g. mono or stereo.
 

ge_rik

British narrow gauge (esp. Southwold and W&LLR)
24 Oct 2009
10,709
1,245
Cheshire
www.riksrailway.blogspot.com
Best answers
0
Country flag
If just an indication of occupancy is all that's required, then my first suggestion would be sufficient, as GAP /PhilP suggest. If A is triggered first then one light would show the train in section is running Down until B is triggered to clear the section. If B is triggered first, then it's an Up train in section until A is triggered.

I suppose you could also program in a fail-safe such that if the second trigger is not sensed after a particular time period then an alarm signal sounds indicating that a train is stuck in the section or somehow the second triggering has failed.

Rik
 
D

Deleted member 4232

Guest
Moved
 
Last edited by a moderator:

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
Staff member
GSC Moderator
25 Oct 2009
26,247
5,001
75
St.Neots Cambridgeshire UK
Best answers
0
Country flag
I would also think that extending the arm as you suggest would have made it harder to operate. A longer arm would need a longer movement to give the same movement to the switch button Wouldn't it?
I have found a couple in my parts box to try tomorrow. The small one with the roller wheel should fit, but the other one is a bit big. (cm grid in pics)
View attachment 230205
View attachment 230204
Greg, No extending the arm would have the effect of making it easier to operate (think of the ease of getting a Nail Out with a Jimmy, the longer the Jimmy the easier it gets), we extended the arm but too much as there is not a lot of space between the Baseboard and where Flange will activate but not be above Rail Height. The Wheel one sans wheel looks to be about right size of what I was referring to.

Still think that a Token would work better, could be a nice big lump of Wood with a small Brass Plate referring to the section it applies to. No Token no go. Token gets left where it was last used to. Ok so a bit of walking and perhaps modest delay, but KISS works well (Keep It Simple Stupid) no insult implied in that.
 

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
If just an indication of occupancy is all that's required, then my first suggestion would be sufficient, as GAP /PhilP suggest. If A is triggered first then one light would show the train in section is running Down until B is triggered to clear the section. If B is triggered first, then it's an Up train in section until A is triggered.
Rik
OK let's try and think it through, as my first reaction is 'it won't work'.

Train leaves A and is detected-Detector A sends Stop signal to signal at B
Train arrives at B and clears signal at B. so far so good.

BUT, both ends have identical logic, so when the train left A it cleared signal at A (OK) but when it arrives at B it sets signal A to Stop. That's Wrong.

Have I got my logic wrong??

It may be possible to overcome this by using the state of the signal at each end as another logic input.