model railway signal control

Thread Starter

patrickwalker

Joined Jul 6, 2019
12
On my N gauge model railway I have used reeds and latching relays to control my signals. I want to switch a relay to automatically identify when the direction of a particular track is forward or reverse so that the correct signals are energised.
See my railway here.
 

eetech00

Joined Jun 8, 2013
4,704
On my N gauge model railway I have used reeds and latching relays to control my signals. I want to switch a relay to automatically identify when the direction of a particular track is forward or reverse so that the correct signals are energised.
See my railway here.
Your terminology is confusing.
A track is either occupied or not occupied.
A turnout (switch) is either lined normal (straight) or revese ( turnout)
A train is either moving forward or reverse.

Train direction is usually determined by detecting a specific sequence of track occupancies.

That said. What are you really asking?
 

MisterBill2

Joined Jan 23, 2018
27,187
Sensing of the travel direction independently of other variables can be done optically, and that same set of circuits can also report the exact speed. It requires a alternating white and black strip on the underside of one car or engine. There are other schemes also.
 

MisterBill2

Joined Jan 23, 2018
27,187
Sensing of the travel direction independently of other variables can be done optically, and that same set of circuits can also report the exact speed. It requires a alternating white and black strip on the underside of one car or engine. There are other schemes also.
Track polarity has not been the means of direction control for quite a few years on the more elaborate layouts like the TS is asking about. So sensing polarity would work only for a simple "kid's" layout but not for one of these. If it had been that simple the TS would not have asked us.
 

Thread Starter

patrickwalker

Joined Jul 6, 2019
12
e
Is it as simple as detecting the polarity of the voltage on the tracks?
If so, here is a simple reed relay circuit.
IHave tried similar. The problem is that the monitored track feed varies as a pulsed DC that goes from zero through 3 to 10 volts as the train accelerates. I would like to energise the relay as soon as the supply starts to go positive and remains operated until the supply starts to go negative and then remains unoperated until the supply goes positive again. I visualize a flip flop controlling the relay but the triggering remains a mystery to me.
 

Thread Starter

patrickwalker

Joined Jul 6, 2019
12
On my N gauge model railway I have used reeds and latching relays to control my signals. I want to switch a relay to automatically identify when the direction of a particular track is forward or reverse so that the correct signals are energised.
See my railway here.
You can see some of my signals changing automatically at around 3.00min.
 

Thread Starter

patrickwalker

Joined Jul 6, 2019
12
Your terminology is confusing.
A track is either occupied or not occupied.
A turnout (switch) is either lined normal (straight) or revese ( turnout)
A train is either moving forward or reverse.

Train direction is usually determined by detecting a specific sequence of track occupancies.

That said. What are you really asking?
If I apply a positive going supply to a particular track to provide forward direction, I want to have some way to a monitor that and automatically activate the signals for that direction because of the polarity of the switchable supply. This would then switch automatically if a reverse direction supply was engaged.
 

MisterBill2

Joined Jan 23, 2018
27,187
OK, this system evidently does not use digital control to the track, but rather variable voltage PWM control. So a sensitive polarity sensor could serve to switch it on, but probably not to switch it off. That seems more like an application for an actual motion sensor, with two positions so that it can sense direction. That could be two IR reflective sensors looking up from under the track, out of sight, which would detect the engine and sense the direction. Then the repeated detection signals would keep the timer reset until the desired delay time had passed. It could also use "beam break" sensing, but that might be more obvious.

It could also use a polarity sensor plus a presence sensor to to know the train was passing that point in one direction. That could be the simplest scheme. One beam break sensor with an IR LED and an IR photo-transistor that would only pass the positive track power pulses to trigger and re-trigger a timer operating the signals while the train was passing. The reverse polarity pulses would not be passed and so the timer would not be triggered.
 
Last edited:

ElectricSpidey

Joined Dec 2, 2017
3,312
So, you are using PWM to control the speed?

So, you need to detect polarity, then provide a constant output for the signals/relay...correct?

If so, it sounds like something you could do with some diodes and 555 timers. (and other assorted components)

How you wire the circuit will depend on whether the PWM is low side switching or high side switching.

Then all you need is a little power from the rails to keep a small capacitor charged.

BOM would be...

2 diodes
2 resistors
2 capacitors
2 555s
2 relays if used (the 555s may be able to drive the signals directly)
and whatever you need to assemble...wire, board etc.

Sorry I can't give a schematic, but I can describe the circuit and operation if interested.

EDIT: After reading post #8 again I see you do not need two separate relays, so the BOM would only be one of each, but the concept is still valid,

Sorry but I may have been overthinking the issue in my post.

You may only need a diode and transistor to do what you need, but you will need to determine what side the PWM is switching.

You may not even need the transistor.
 
Last edited:

eetech00

Joined Jun 8, 2013
4,704
If I apply a positive going supply to a particular track to provide forward direction, I want to have some way to a monitor that and automatically activate the signals for that direction because of the polarity of the switchable supply. This would then switch automatically if a reverse direction supply was engaged.
Is the "positive going supply to a particular track" a steady DC signal on the track rails? or is it a PWM signal (DC pulses of varying width) on the track rails providing forward direction?

And what are the DC voltage levels?
 

Thread Starter

patrickwalker

Joined Jul 6, 2019
12
So, you are using PWM to control the speed?

So, you need to detect polarity, then provide a constant output for the signals/relay...correct?

If so, it sounds like something you could do with some diodes and 555 timers. (and other assorted components)

How you wire the circuit will depend on whether the PWM is low side switching or high side switching.

Then all you need is a little power from the rails to keep a small capacitor charged.

BOM would be...

2 diodes
2 resistors
2 capacitors
2 555s
2 relays if used (the 555s may be able to drive the signals directly)
and whatever you need to assemble...wire, board etc.

Sorry I can't give a schematic, but I can describe the circuit and operation if interested.

EDIT: After reading post #8 again I see you do not need two separate relays, so the BOM would only be one of each, but the concept is still valid,

Sorry but I may have been overthinking the issue in my post.

You may only need a diode and transistor to do what you need, but you will need to determine what side the PWM is switching.

You may not even need the transistor.
Thanks for your thoughts. My controller supply is simply a full wave rectified DC, 2 transistor control. The sensing circuits I have tried simply buzz as the amplitude of the ripple increases with speed. I need some thing that will latch, perhaps a flip flop, which will operate my signal control relay whilst the supply being monitored continues to control the train speed down to stop. Then to flop the flip flop to switch the relay as the reverse polarity is applied to give the opposite direction.
I have a supply of 555 chips which I use to control my servo driven points. You can see this in video here.
 

Thread Starter

patrickwalker

Joined Jul 6, 2019
12
Is it as simple as detecting the polarity of the voltage on the tracks?
If so, here is a simple reed relay circuit.
I would like to monitor the track supply as it varies between zero and 12 volts and switch a relay whilst one polarity is present to enable signals for that direction only.
The controlled supply is a fullwave rectified DC with 2 transistor analog control.
I would like it to detect voltages over 1.5 volts up to a maximum of 12 volts. This being the speed control window.
 

ElectricSpidey

Joined Dec 2, 2017
3,312
Ok now the controller sounds like it's analog, but in a previous post you said "pulsed DC" which I assumed was PWM.

Answer this...

Do you change direction using a DPDT switch? (or relay)

Does your controller have a filter capacitor?

If you do the solution is just as I stated in my last post where you just need to tap the "uncontrolled" polarity from the track to the relay and connect the other side of the relay to the supply (probably the positive) not the track.

This will energize the relay when that rail is negative and de-energize it when the rail is positive.

Tap the rail that is negative when the train is going "forward". (and use a diode to prevent back feeding current)

The changeover will be completely dependent on the polarity and not the voltage level.

This assumes the varied side from the controller is positive and not negative, if it's negative then you need to reverse everything.

You will be making a simple series circuit...from one rail to the diode then to the relay coil then to the power supply. (then of course however you wire the contacts)

This concept has some issues...please ignore.
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,187
OK, now that there is some more information provided, one more question: Is there a separate power source, isolated from the tracks power , that is available?? such as might supply lighting for the buildings, or power to drive the switches and decouplers?? It seems that the addition needs to sense both the presence of the train and it's direction of travel. Direction is easily found by the polarity, presence of the train is less easy. Is the presence of the train sensed elsewhere in the layout?? If so, by what method??
Thus far I have seen no response to any of my suggestions for optical sensing, and no hint that any method of sensing the train presence has been mentioned.
 

ElectricSpidey

Joined Dec 2, 2017
3,312
I will have access to my other PC later today, so I'll post something for an unfiltered control supply.

EDIT: Have to withdraw my idea, came up with some unforeseen problems...sorry.

Anyone that might have copied the schematics I posted, please just delete them.
 
Last edited:

sparky 1

Joined Nov 3, 2018
1,218
There is a shared project which means you can buy an inexpensive pcb. I see that one person replicated this and it worked as intended for street intersection light.
A RR traffic would have some of the same features and it might include plan B operation which is for safety in the event that digital stops working.
When you have both RR and Street the combination of both makes an impressive and dynamic system that models can be very useful.
When I read about RR crossing accidents I can see how 4 way controllers improve safety.
https://www.pcbway.com/project/shareproject/4_way_Traffic_Light.html

 
Last edited:
Top