Track Circuits (Train on Track Indicators.

Post all your model railway electronic problems, solutions and discoverys here.
User avatar
Albert
Posts: 67
Joined: Fri Dec 26, 2014 5:33 pm
Location: Scotland

Track Circuits (Train on Track Indicators.

Postby Albert » Fri Mar 27, 2020 5:13 pm

Hello all,

I've been out of things for a while but I'm just resurrecting a project to control a DC layout using an arduino. I'm starting simple with an oval and two locos. The idea is that they follow each other around the track, relying on block working and track circuits to avoid ever actually catching up. I need help identifying a source of track circuits that won't break the bank, in case I develop all this further.

The plan is to have four blocks with a track circuit on each one and a signal at the beginning of each block. All the time the track circuit can detect a loco in its block it sets the entry signal to red.

If a loco enters a block where the following entry signal is red then it brakes gracefully to a halt just before the signal. Once the loco occupying that block moves to the next one the signal goes to green and the following loco can proceed.

In its first incarnation I was using photocells to keep track of loco positions, but that caused much complication, both in circuitry and in coding. A proper occupancy track circuit should improve all this.

Back in the day I was a member of MERG and their TOTI modules seem suitable. However, looking at their present catalogue they only seem to offer kits for a 2 channel DC TOTI, as against the original 12 channel PCB. I'd be happy to rejoin MERG if need be but if anyone has any other suggestions I'm all ears.

By the way, is it possible to change my username?

Albert
Albert

D0260
Posts: 227
Joined: Thu Jun 11, 2009 6:55 pm

Re: Track Circuits (Train on Track Indicators.

Postby D0260 » Fri Mar 27, 2020 6:04 pm

Have a look at this video.......

https://www.youtube.com/watch?v=KleQt1fx2Go

Track detectors can be expensive though...

User avatar
RAF96
Posts: 676
Joined: Tue Feb 19, 2008 1:39 pm
Location: Dereham, Norfolk, UK

Re: Track Circuits (Train on Track Indicators.

Postby RAF96 » Fri Mar 27, 2020 9:33 pm

Just contact site admin and request that they change your username Albert. I had mine shortened some time ago.
RAF Halton Brat - 96th Entry
http://www.halton96th.org.uk/robs_rails.html
β-tester

User avatar
Albert
Posts: 67
Joined: Fri Dec 26, 2014 5:33 pm
Location: Scotland

Re: Track Circuits (Train on Track Indicators.

Postby Albert » Sat Mar 28, 2020 3:56 pm

D0260 wrote
Have a look at this video.......
...
Track detectors can be expensive though...
Thanks, but I'd really lke to find a way to solve this without throwing lots of money at it.

I seem to remember that Roger Amos had a design, so I've ordered his book. His web site has disappeared and there are surprisingly few hits for his name on Google. Is he no more?
Albert

fourtytwo
Posts: 114
Joined: Mon Oct 31, 2016 7:41 pm
Location: Norfolk (Bodecia's country) UK

Re: Track Circuits (Train on Track Indicators.

Postby fourtytwo » Sun Mar 29, 2020 12:06 pm

Hello Albert

I don't know how much you like tinkering or burning your fingers but here is a simple 3 transistor circuit I have used for years, it is bi-directional and is easy to adapt for different voltages etc. The supply to a section passes through a diode and the voltage across the diode is sensed by a transistor (note there are two diode/transistor pairs, one for each direction). Of course the collector current is relative to the traction voltage so a higher voltage (bias supply) must be used for the pnp sense transistor to ensure the sense current is not interrupted at the peak traction voltage. Such a bias supply is easy to obtain as the current is very low so a voltage doubler etc works very well. This is a very cheap circuit, the most expensive part being the veroboard!!
The attached schematic is from an LTspice simulation where the entire system is simulated including the controller (to the left). If you are interested drop me a line for further details.

Roger

Controller_Tcircuit2.png


PS the transistors can be almost anything that has a high enough breakdown voltage and enough gain, the ones in the schematic were either what I had in my junkbox or what I had a sim model for. Also note the occupied signal is sensitive to track dirt and requires filtering in software.
Does the pain of N gauge steam ever end!

User avatar
Albert
Posts: 67
Joined: Fri Dec 26, 2014 5:33 pm
Location: Scotland

Re: Track Circuits (Train on Track Indicators.

Postby Albert » Sun Mar 29, 2020 11:15 pm

Thanks. I'm going to have to get my head around this. Unfortunately 'transistors' and 'of course' don't go together for me.
Albert

fourtytwo
Posts: 114
Joined: Mon Oct 31, 2016 7:41 pm
Location: Norfolk (Bodecia's country) UK

Re: Track Circuits (Train on Track Indicators.

Postby fourtytwo » Mon Mar 30, 2020 9:41 am

Sorry Albert I was not sure if you made your own arduino circuits.
I can customise this for you if you tell me
Is your arduino 5V or 3V3 (or what is the part number of the chip) ?
What controller do you use for your railway ?
What transformer secondary voltage you use for the controller ?
Do you have any unused secondaries (for the bias supply) ?

Here are some scope shots of the occ signal, with a steam loco (hall 060 chassis) it is quite noisy whilst with a railcar (bo-bo) it is much cleaner
OCC hall in section.png

OCC railcar entering section.png

OCC railcar leaving section.png
Does the pain of N gauge steam ever end!

User avatar
Albert
Posts: 67
Joined: Fri Dec 26, 2014 5:33 pm
Location: Scotland

Re: Track Circuits (Train on Track Indicators.

Postby Albert » Mon Mar 30, 2020 1:31 pm

Thank you, fourtytwo.

Yes, I know which end of a soldering iron to hold, but I'm much more at home with digital systems (designed and built my own video digitiser back in the 80's). When it comes to working directly with transistors I'm happy enough with concepts and (very) basic theory, but have absolutely no 'feel' for what makes sense in practice.

Is your arduino 5V or 3V3 (or what is the part number of the chip) ?

5v, I'm pretty sure.

What controller do you use for your railway ?
The arduino! It operates the locos by PWM DC. So far, 'railway' is a bit of an overstatement: it's an oval divided into 4 segments.

What transformer secondary voltage you use for the controller ?
See above. But I have a couple of spare switched mode DC wall warts with a choice of voltages. No source of -v, or low voltage AC, though

Do you have any unused secondaries (for the bias supply) ?
See above.

The Arduino came in a sizeable learning kit so I'll look to see what transistors and suchlike I already have.

Thanks again.

Albert
Albert

fourtytwo
Posts: 114
Joined: Mon Oct 31, 2016 7:41 pm
Location: Norfolk (Bodecia's country) UK

Re: Track Circuits (Train on Track Indicators.

Postby fourtytwo » Mon Mar 30, 2020 4:58 pm

Hi Albert, thank you for the replies, may I ask what gauge your running (just for an idea of motor currents) ?
The detector needs a bias supply 5-10V higher than the PWM supply voltage
Depending on the PWM frequency you may need synchronous detection, meaning the OCC signal will only be high when the PWM switch is on, or simply filter the OCC signal (in software) to ignore the PWM frequency.
If you are using N gauge you may end up with pitted tyre plating from PWM as I did but only noticeable after quite some time, this may be related to the motor inductance being lower than larger scales and also how aggressive (rise time and peak voltage) the PWM is.

I have also tried optical and magnetic methods but they suffer from intermittent detection and false states, IMOP continuous detection is the way to go :) There is another method I used yonks ago again using a bias supply higher than the highest traction voltage and that is a high impedance relay!! In my long past youf I used PO3000 relays with a 48V bias supply and no flyback diode, used to keep the cats and stray fingers of the track and swear it did a pretty good job of pseudo track cleaning too :lol:
Does the pain of N gauge steam ever end!

User avatar
Albert
Posts: 67
Joined: Fri Dec 26, 2014 5:33 pm
Location: Scotland

Re: Track Circuits (Train on Track Indicators.

Postby Albert » Mon Mar 30, 2020 8:24 pm

Hi, fourtytwo

In its original incarnation I was using HO (00 to Brits) on a 2ft diameter circle of track! PWM gave me all the control I wanted for my purposes. I've now moved to N to get more railway on a small board.

I believe that Arduino PWM runs atbetween 500 and 1000 Hz, depending on the model. I did consider using a capacitor to provide some smoothing.

By the way, I've done a swift stock-take and find I possess 5x PN 2222A 6E and 5x S8050 D 331 transistors. Haven't hd a chance to find out what that means yet!

Oh, yes! N gauge steam!!!!!?????????

Cheers

Albert
Albert

fourtytwo
Posts: 114
Joined: Mon Oct 31, 2016 7:41 pm
Location: Norfolk (Bodecia's country) UK

Re: Track Circuits (Train on Track Indicators.

Postby fourtytwo » Tue Mar 31, 2020 9:32 am

Hi Albert
A capacitor might absorb some of the aggressiveness as would a series inductor. If you had access to an oscilloscope you could check the risetime and/or the peak current. Otherwise check your loco tyres under a magnifier.

In the meantime I am afraid I still don't know what the operating voltage of your PWM is so cannot tell if your transistors are suitable. The 2222A's have a VCEO of 40V but that may be rather close to the final bias voltage!
Does the pain of N gauge steam ever end!

User avatar
Albert
Posts: 67
Joined: Fri Dec 26, 2014 5:33 pm
Location: Scotland

Re: Track Circuits (Train on Track Indicators.

Postby Albert » Tue Mar 31, 2020 11:12 am

Hi fourtyrwo
Sorry, the pwm voltage is whatever you feed to the arduino, which basically is just a timer and a switch. I'd expect rise time to be practically instantaneous.

I normally use 12v, taken from a wall wart switch mode transformer. If I understand so far that means the bias voltage would be about 24v, well under 40v limit you mention.
Albert

fourtytwo
Posts: 114
Joined: Mon Oct 31, 2016 7:41 pm
Location: Norfolk (Bodecia's country) UK

Re: Track Circuits (Train on Track Indicators.

Postby fourtytwo » Tue Mar 31, 2020 12:22 pm

Hi Albert, great!! So do you have another 12V wallwart you could add in series with the first to make a 24V bias supply ?

In any case here is a drawing assuming just that, the controller has been replaced with a PWM like your arduino and the NPN transistors with your 2N2222's, note the PNP is a commonly available 2N3906. This is very sensitive sufficient to detect axles with 10K or even higher resistance allowing you to detect entire trains not just the loco.

Albert-1.png
Another try, monochrome
Last edited by fourtytwo on Tue Mar 31, 2020 7:00 pm, edited 1 time in total.
Does the pain of N gauge steam ever end!

User avatar
Albert
Posts: 67
Joined: Fri Dec 26, 2014 5:33 pm
Location: Scotland

Re: Track Circuits (Train on Track Indicators.

Postby Albert » Tue Mar 31, 2020 3:35 pm

Thank you, fourtytwo.

I'm going to need a little while to get my head around this. Would it make sense to switch to private messages, or even email, to handle any further questions I'm bound to have?

You are right about the image quality. It looks reasonable on my screen, but printed out the lines are almost invisible.Is there any way you could create a version with the lines a bit bolder?
Albert

fourtytwo
Posts: 114
Joined: Mon Oct 31, 2016 7:41 pm
Location: Norfolk (Bodecia's country) UK

Re: Track Circuits (Train on Track Indicators.

Postby fourtytwo » Tue Mar 31, 2020 7:07 pm

I found the quality issue, it was in color, I have now printed it in monochrome and it seems much better. The original diagram was done over a year ago and either I had run out of color ink or some other reason printed it in monochrome and I eventually figured that was the difference :oops:

Anyway if we keep q&a visible anybody else interested can also follow.....I usually look at this site a few times a week but could be more often if things are humming.......

One thing I would recommend is building just one sections worth and trialing/tuning it before constructing more :)
Does the pain of N gauge steam ever end!


Return to “Electronics”

Who is online

Users browsing this forum: No registered users and 2 guests