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
So not so far to walk to get a Token then if all the Tecky solutions too difficult with Wiring runs and workable solutions then.
I am impressed with your split token system, but it's probably too complicated even for me. My mate Keith, whose GR I'm talking about would not have a bar of anything so complicated. He is not into 'operation'. If we have to walk to the other end to get a token, we are virtually walking along the track, so could see if the section was occupied.
Four of us will be running at Keith's tomorrow, so we'll see if there are (m)any head-ons with NO sort of indications. If, not, I'll probably shelve the whole idea. (I still might install something on my GR which has much longer single line sections which are hidden from view, just for the mental exercise.)

Long ago when I had RC track power, every single line section had a separate transmitter controlling power to that section, so these Tx formed the token. But all that went by the board when I converted to battery RC.
 

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
I've had many problems trying to use the ultrasonic detectors which I've mentioned in the above topic. (you can zip over and read about my tribulations there if you want )

But I have had success in writing the program to control a single line signals – I just need reliable detectors.
This video shows me testing it on an indoor track. One detector is the ultrasonic one (working OK with just a loco) and the other end is an infra-red detector. (more on that in the future)



With a detector at each end of a single line section, I can control the signals at both ends:-
setting one end to Stop when a train enters the other end, and
allowing up to 3 train to follow one another through a section (divisible staff?) , and
allowing a train to shunt onto the single line and return off it at the same end.

After thinking about wireless connection between the two ends and sending data packets, I finished up using a good old fashioned analogue method of communication between the two ends.

I'll use a 2-wire link and 4 different dc voltages on the line to 'count' the number of trains in a section. The voltages are just held on a capacitor on the line and so either end can change it as trains enter and leave the section.
 

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
Staff member
GSC Moderator
25 Oct 2009
26,171
4,993
75
St.Neots Cambridgeshire UK
Best answers
0
Country flag
Greg thanks for your interest in my Split Token System after a recent Post here in the thread I think a simpler system has appeared for you. Much on the lines of what I was preaching and it is NSWGR as well!

https://www.shapeways.com/product/8P739UY6Y/nswgr-staff-square-large?optionId=64047069

https://drive.google.com/file/d/1tOtjwE5zFuVO0VIdlm83f2_6Lvvdc_QS/view

https://drive.google.com/file/d/1-g014OBANQFSVSi8SRhN4KU4GJ4hnnKz/view

You appear to have sort of accepted some wiring on the Section and it is possible that a Battery Type of Plug and Socket or some such could work with this to operate signal indications. Of course if the Token Is not present a bit of walking may be required to get it, shades of a boy on a bike to recover a Token when more Trains are going one way than the other. But it is all prototypical and if the rules are followed foolproof.
 

ge_rik

British narrow gauge (esp. Southwold and W&LLR)
24 Oct 2009
10,701
1,244
Cheshire
www.riksrailway.blogspot.com
Best answers
0
Country flag
Brilliant, Greg! I appreciate that underlying its apparent simplicity is a heck of a lot of clever coding. Great work!

Rik
 

ge_rik

British narrow gauge (esp. Southwold and W&LLR)
24 Oct 2009
10,701
1,244
Cheshire
www.riksrailway.blogspot.com
Best answers
0
Country flag
...... and if the rules are followed .........
There's the rub, Jon.
Hopefully, Greg's Picaxe programming removes the human fallibility factor.

Rik
 

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
Staff member
GSC Moderator
25 Oct 2009
26,171
4,993
75
St.Neots Cambridgeshire UK
Best answers
0
Country flag
There's the rub, Jon.
Hopefully, Greg's Picaxe programming removes the human fallibility factor.

Rik
Erm not sure it would Rik as what is to stop someone just driving past any Signal ignoring it completely? I think the line that Greg is working on this for will be all Battery.

Prior to a running session on my line I give a briefing at which the importance of maintaining Single Line Discipline stating the cost and value of my Locomotives and Trains and that I do not want them crashing down 3-4ft onto a Concrete Path because of a Corn Field Meeting (head on collision to us in UK). These things need to be understood by guests, particularly Live Steam bods where a certain amount of logic escapes their minds because they ‘only have 25-30 minutes running time’ we have all seen such bods at Private Open Days and Club Layouts. They seam to forget that someone’s pride and joy with a possible value of up to 3-5k can be expensively damaged. But it can be just as upsetting for your 100 squid loco that you have laboured long and hard to either buy or make.
 

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
Thanks Jon, interesting links.

But going back to my original problem - a friend wanted a simple indication of a train in a single line. No mods to trains, no complicated actions by operators - just look at a light.
Once he agreed to get 2 wires from one end to the other, I was able to design a really simple system where operator presses a button when he's ready to enter the section, and the other end shows a red signal for a set time. There is an option to sound an alarm if a train passes a signal at red (SPAD).
here's the info....


relay detect cct.jpg

But we have never installed it.

In the meantime I got interested in a designing an electronic system to avoid the operator pressing a button - hence the need to detect a train and its direction. And it snowballed from there.
This has become a bit of an obsession - it's easier to sit inside, doing programming or soldering, during summer, than to work on the train outside.
I doubt I'll ever install it on my railway even, but it's a fun project, keeping my brain active.
 
  • Like
Reactions: 1 user

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
Well it’s been 4 months since I started this topic (crusade? Obsession?), But I have finally done it.

Just as a reminder, I started trying to design a very simple single line ‘warning’ system for a mate. He decided he didn’t need it, but by then I had become obsessed with making a completely automatic, single line signalling system.

After wasting 3 months trying to get an ultrasonic detector to work and giving up, I then tried to use infrared beams reflected off the sides of trains. That proved very ‘iffy’ in getting good detection from low sided flat wagons.

So I went back to my tried and trusted method of infrared (IR) beams across the track. I have used this method for years to control the turnouts on reverse loops. Very reliable, as the loco/wagon breaks the beam – ie on or off. The only problem is gaps between wagons and it is hard to set up initially.

So this is the arrangement I’ve come up with. The IR transmitting diodes are on the left and the receivers are inside the signal hut, with the rest of the electronics. The signal head is on the wall – they are meant to be visible to operators – not scale train drivers!
mela instal4 capt.jpg

and this is what is inside the hut:
Mela cct board.JPG
There’s 2 detectors approx 100mm apart so that the order in which they detect means I can tell the direction the train is travelling. There’s one of these ‘pairs’ at each end of the single line. They are connected by a single pair of wires.

Then came the part that really exercised my old brain. Writing (and testing) the logic programs for the picaxe microcontrollers I use at each end. But finally I think I have it all working and installed on the single line between my Termite and Melaleuca stations.

Basically it allows up to 3 trains to follow one another through a section, and allows trains to shunt out into a section and then return without upsetting the signals logic.

Signal aspects are Stop, Caution and Clear and may be either red and green leds (red+green=Caution) or a servo operated 3-aspect semaphore.
I have made a video that illustrates some of the many scenarios that the logic has to cater for.
(I have since installed a much brighter green led!)

For those of you still with me, here’s some of the ‘specification’ that I set myself.
a) When a train enters the single line at A, the signal at A shows Stop for say 10 seconds, then shows Caution as an indication that a 2nd train is now allowed to follow. It also sends a 'message' to B indicating 'one train in section' which causes the signal at B to show Stop.
b) if the train continues through the section, when it leaves at B, the B signal clears and sends a message to A indication 'no train in section', and that clears the A signal.
c) If a second train follows the first into the section at A, the signal at A again shows Stop for 10s and then Caution. (still allowing for a 3rd train to follow later) but a message is sent to B indicating there are 'two trains in the section'. When the first train reaches B, no signals change, but the message to A indicates only 'one train in section'. When that second train arrives at B, its signal clears and the message to A saying 'no trains' causes A to set its signal clear.
d) if a 3rd train has followed the first two at A, the signal at A shows Stop to indicate no more trains can follow. The message to B indicates 'three (or more) trains in section'. As the trains arrive at B, the messages 'count down' and the signal at A reverts to Caution when only 1 or 2 trains are left in the section, and clears when there are no more trains in section.
e) whenever a trains passes a stop signal, an alarm sounds. This occurs for either
1) entering from the wrong end onto an occupied section, or
2) a 4th or more following/shunting train entering from one end, or
3) a following/shunting train entering the section from one end, while the 10s timer is active (see a).

There are MANY other cases mainly to do with shunting trains etc. which are too numerous to mention without boring you more.

It might be easier to list the scenarios where it operates INcorrectly
  1. When 4 or more trains follow one another from one end. After the 3rd train reaches the other end, both ends show clear even though there are trains in the section A wrong-side failure.
  2. When a train does not clear both detectors and then it backs out, the signal still shows Caution even though no trains in section. A right-side failure. Use Reset Button to clear both ends.

  3. When a train enters or leaves both ends ‘at the same time’.
And having finished it, I doubt I’ll ever install any more on my other single line sections.
If I did do it again, I’d go for the simpler idea of only one train allowed in the section – no following trains, no Caution signals – just Stop or Clear.
 

Attachments

  • mela instal4.JPG
    mela instal4.JPG
    98.8 KB · Views: 0
  • Like
Reactions: 1 user

ge_rik

British narrow gauge (esp. Southwold and W&LLR)
24 Oct 2009
10,701
1,244
Cheshire
www.riksrailway.blogspot.com
Best answers
0
Country flag
Wow! What a tour de force! I must admire your grit and determination in seeing this project through. It's not been an easy one by all accounts but, as they say, persistence pays. It strikes me that this sort of train detection and signalling is something to which Pic chips are well suited.

I'd love to figure out some way of setting up a system which can automatically control two trains travelling in opposite directions around my main circuit, both under radio control. I reckon it must be feasible using modified Deltang transmitters and sensors on the track. Maybe I'll pick your brains on that one (when I get back from India).

Rik
 

GAP

G Scale Trains, HO Trains, 1:1 Sugar Cane trains
14 Jun 2011
4,059
944
Bundaberg Queensland, Australia
Country
Australia
ringbalin-light-railway.blogspot.com
Best answers
0
Country flag
Thanks Rik and Graeme. Don't give me more ideas!
Looks like there is not a lot of Forum interest in this type of project.

I think the mention of electricity or electronics scares a lot of people off.
I can load you up with tons of ideas if you want a couple.
 

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
33,567
3,521
Nottingham
Best answers
0
Country flag
Interested.. But would depend on:
1. Actually building a railway..
2. Fred not hogging all the round-tuit's..

One for the back-burner..
 

No72

Registered
21 Dec 2014
221
199
Melobourne Australia
Best answers
0
As usual Greg your persistence pays off. Very well thought out solution.
I on the other hand have stayed with the magnets and reed switches and have since discovered a cheap latching relay module which for trams works very well but as I'm using R/C I don't use the relay to cut power to the track. I've trained my motorman to stop at red lights and also at the Tram at Terminus sign....
https://www.ebay.com.au/itm/DC-5V-1...hash=item41dbed5605:m:m3rA7zn27bQOc7tuiLDv3bw
 

Attachments

  • DSCF2167 (Medium).JPG
    DSCF2167 (Medium).JPG
    173.9 KB · Views: 0
  • DSCF2169 (Medium).JPG
    DSCF2169 (Medium).JPG
    179.8 KB · Views: 0
  • DSCF2173 (Medium).JPG
    DSCF2173 (Medium).JPG
    252.1 KB · Views: 0

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
I assume the 'thing' is not actually a touch switch but a reed sw? Any chance of a quick description?
eg train with magnet latches relay at one end, then what........ ? signal goes red? when/how does it clear?
 

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
Staff member
GSC Moderator
25 Oct 2009
26,171
4,993
75
St.Neots Cambridgeshire UK
Best answers
0
Country flag
Thanks Rik and Graeme. Don't give me more ideas!
Looks like there is not a lot of Forum interest in this type of project.
Looking at your superbly done system I immediately thought wow great for a Tram Layout. Looks like Trev has sorted some thing that works for him as well.
As usual Greg your persistence pays off. Very well thought out solution.
I on the other hand have stayed with the magnets and reed switches and have since discovered a cheap latching relay module which for trams works very well but as I'm using R/C I don't use the relay to cut power to the track. I've trained my motorman to stop at red lights and also at the Tram at Terminus sign....
https://www.ebay.com.au/itm/DC-5V-1...hash=item41dbed5605:m:m3rA7zn27bQOc7tuiLDv3bw
Good to see real operational issues being resolved in a way that many of us numpties electronically speaking can copy.
 

No72

Registered
21 Dec 2014
221
199
Melobourne Australia
Best answers
0
Looking at your superbly done system I immediately thought wow great for a Tram Layout. Looks like Trev has sorted some thing that works for him as well.

Good to see real operational issues being resolved in a way that many of us numpties electronically speaking can copy.
Let me tell you a little story about the colour light staff ( I'll assume you know to what I'm referring) If you are using DC PWM track control you can make a quasi automatic system but I would not personally trust it. But on the tramway modelers FB group I got banned for allegedly playing guessing games because they did not know what "Forest City Colour light staff " was. I only know enough about electronics to be dangerous and my more or less off the shelf solution was born of necessity.
 
  • Like
Reactions: 1 users