Jump to content
 

Train detection question


aleopardstail
 Share

Recommended Posts

Currently building a small test layout, and working on train detection. The plan is to have current sensing for "block" detection, this is semi-working and should be nailed with some better resolution ADC boards shortly (the 10 bit in the arduino not quite managing it, figure a 16 bit ADS1115 should be fine in comparator mode). This will say "something is in this block" and I gather JMRI can work with that.

 

It was then planned to have an IR sensor (LED & phototransistor) looking up to provide a "train is at this exact point", to trigger changing speed or halting completely. I don't yet have these, I'm familiar with the technology though and should be able to assemble small surface mount sensor heads to fit between N gauge sleepers.

 

however, I'm wondering, can JMRI manage a "virtual block" that has actual sub blocks?

 

Untitled.png.7eab9fea0c91fa3cbf99ea6dfd197167.png

e.g. what I'm wanting is for the signalling logic to see a train in any or all of 1a,1b & 1c as "occupying block 1", but picking up entering block 1c as the "ahh, now slow for the signal" point in the same was an IR sensor at point "x" would do so the train can slow to stop roughly as point "y"?

 

in practice some blocks would probably just be two detection zones, a main bit and a signal approach bit, others would be three especially if running in both directions

 

Q: how viable is this?

 

Q (bonus!): which approach is generally considered "better"?

Link to post
Share on other sites

Im sure others will answer this better than I, but I think you are trying to make this unneccessarily complicated. If 1a, 1b,1c have individual detectors, and are of known length, if the train speed is known then so is the position within the block, data that can be used to stop a train to within mm of a desired location. So I dont think the secondary setup of the sensor is required, although i understand that people do use them this way. Im not familiar with JMRI specifically but stopping at position is such a basic within automation Im sure it can do it.

  • Like 1
Link to post
Share on other sites

  • RMweb Premium

You should be able to do it with just the one current sensor per block. The computer automation programs can do that.

 

However to do that you have to know how fast the train is going and how it's speed decelerates once entering the block, so careful speed calibration of the loco/train is required.

I assume that is also part of JMRI, however I'm not familiar with JMRI beyond DecoderPro.

 

I can stop a train within 5mm or better in a 180cm block with just one current sensor (I use Train Controller but I don't see that the other programs should be much different)

Edited by melmerby
  • Like 1
  • Agree 1
Link to post
Share on other sites

2 hours ago, RobinofLoxley said:

Im sure others will answer this better than I, but I think you are trying to make this unneccessarily complicated. If 1a, 1b,1c have individual detectors, and are of known length, if the train speed is known then so is the position within the block, data that can be used to stop a train to within mm of a desired location. So I dont think the secondary setup of the sensor is required, although i understand that people do use them this way. Im not familiar with JMRI specifically but stopping at position is such a basic within automation Im sure it can do it.

 

it is almost certainly overkill, the goal though is to be able to manage trains that lack calibrated speeds (or even roughly calibrated), its a tiny layout but really experimenting with stuff that could work on a larger one.

 

operating goal is to know a block is occupied so as not to allow anything else in with the main "block" sensors (which could be several sub blocks into a larger virtual one), then use the higher accuracy ones to trigger actions within the block (e.g. trigger a "stop" action such that a train has a bit of space to gradually stop (using 6" here) to then be a few inches clear of the signal.

 

currently not used JMRI much other than for programming decoders, aware some sort of custom logic could do this without too much trouble, just wondered how hard it would likely be.

Link to post
Share on other sites

1 hour ago, melmerby said:

I can stop a train within 5mm or better in a 180cm block with just one current sensor (I use Train Controller but I don't see that the other programs should be much different)

Indeed iTrain also.

 

Perhaps a (grossly oversimplified) explanation of the approach used by iTrain to do this would be helpful.  You specify certain details of each individual item of your rolling stock to the system, so that the software knows how far back the first detectable axle is from the front of the  train and you also calibrate each loco's speed characteristics so that the system can work out how long it will take to reach point "Y" on your diagram after block 1 is detected as occupied.  This enables it to work out when to decelerate, so stopping is calculated by dead reckoning.

 

I agree with Robin that you re overcomplicating it, but I don't have experience of JMRI, so I can't answer your first question.  As to your second question, there are a number of threads about the whole question of DCC and the best approach to automation, controlling speeds, stopping in the right place etc.  My impression of the consensus is that JMRI is OK as a basic approach but software packages such as TrainController and iTrain are easier and better (though of course, at a cost).  Those who have tried both seem to have concluded that the JMRI configuration procedures get too complex. 

 

No doubt you appreciate that if a train is approaching the signal protecting Block 2 at Danger, the driver isn't waiting to  point "X" before decelerating but the signal protecting Block 1 will be single yellow and the one in rear will be double yellow, so the driver (if the train is at line speed) should be slowing well before the train even reaches the first signal on your diagram.  Because modellers have to cheat a bit on distances and speeds, I think you only need one block per signal on plain track.  That's what the prototype does too.  Having said that because of leakage currents there is a practical length limit to a traditional track circuit, so they do often link a series of physical separate track circuits into one logical one.

  • Like 1
Link to post
Share on other sites

  • RMweb Premium

I get the impression that the free software Rocrail might be capable of doing the job but could be easier to use than JMRI.

There is also plenty of online documentation which would help.

 

Rocrail will run on a Raspberry Pi. (as will iTrain)

Edited by melmerby
Link to post
Share on other sites

have a (basic) understanding of real world signalling and how multi aspect & blocks works, only real reason for multiple blocks or point detectors is to replicate the drivers ability to react to a signal - this will be a loop with four signalling blocks and four aspect (because if over complicating something dive right in I say), so we have either tail chaising or tail chasing with an intermediate point - that rare thing "common sense" suggests while each signal has a stopping point the actual speed before that will indeed depend on what the preceding signal was - so a single train will run at whatever line speed is here but have two and both will run slower as they will be under a caution aspect of some sort all the time.

 

aware there are other systems, but the Yorkshire in me is cheap.. may end up with something more dedicated anyway as none of the signal logic will be massively complicated and there won't be a huge amount of stock to keep track of.

 

every rabbit hole seems to lead to more and more rabbit holes

 

currently using DCC++EX to drive things, pondering changing that at some point to run on something slightly more powerful but thats a while off yet

Link to post
Share on other sites

5 hours ago, melmerby said:

Rocrail might be capable of doing the job ... plenty of online documentation which would help.

My experience of the Rocrail documentation is that it is of the "can't see the wood for the trees" variety.

 

Yes, there is plenty of documentation, but most of it is deep down in the weeds details and the higher conceptual level stuff is entirely missing. Result - lots of functionality that it is very hard to understand how to use.

 

Worse, I found that a good percentage of the details did not match the actual software - the common problem of dated documentation that does not keep up with changes in the software, I think.

 

Yours, Mike.

Link to post
Share on other sites

Actually this queston has thrown up one of mine, which I needed to check before I do the wiring for it.

 

Say I have a block, isolated by irj's, that comprises 5 pieces of track, each with individual droppers, but connected at layout level by fishplates. Do I connect all 5 droppers together and send the combined element to the input of the current sensing device, or do I connect one dropper to the current sensor and connect the other four back to the power bus direct. I assume its the former but just checking.

Edited by RobinofLoxley
Link to post
Share on other sites

6 minutes ago, RobinofLoxley said:

Actually this queston has thrown up one of mine, which I needed to check before I do the wiring for it.

 

Say I have a block, isolated by irj's, that comprises 5 pieces of track, each with individual droppers, but connected at layout level by fishplates. Do I connect all 5 droppers together and send the combined element to the input of the current sensing device, or do I connect one dropper to the current sensor and connect the other four back to the power bus direct. I assume its the former but just checking.

 

Assuming you are using it to detect "train in block" you are correct. It's the former.

  • Like 1
  • Agree 1
Link to post
Share on other sites

  • RMweb Gold
On 06/05/2021 at 12:04, melmerby said:

I get the impression that the free software Rocrail might be capable of doing the job but could be easier to use than JMRI.

There is also plenty of online documentation which would help.

 

Rocrail will run on a Raspberry Pi. (as will iTrain)

 

I got train detection working in JMRI, but found tracking a train around the layout very hit-and-miss. I haven't got any experience of RocRail but I switched from JMRI to iTrain and everything became a whole lot easier. 

Link to post
Share on other sites

The train automation programs from what  I can tell and certainly how iTrain works are based on profiling the locomotives.  Once the automation program knows how far the train moves at each speed setting it can very accurately predict the train stop position.   If you plan on running unprofiled locomotives then a 3  sensor block with a  stop block at each end of the overall block reduces the requirement for profiling. The stop blocks cound be current or spot detection depending on requirement. 

Link to post
Share on other sites

cheers, got the current sensors working in the endBlock-detection-circuit.png.966fce94ecf012b8983dc5de78f09846.png

needs a slight tweak to cope with noise from a nearby servo driver but it works, next to build the IR sensors.

 

managed to get JMRI to see multiple physical blocks as a logical section

 

Link to post
Share on other sites

  • 2 weeks later...

you can use IR sensor, better still use a new block current sensing, telling

the loco too slow downand then  to  stop when entering the next block,                                           this can be part of the main block. all locos will stop in the same place,  mackenzie

railway uses ir sensor and chadwick railway will be useing current sensing as stop

markers

Link to post
Share on other sites

  • RMweb Premium
On 11/05/2021 at 16:49, aleopardstail said:

cheers, got the current sensors working in the endBlock-detection-circuit.png.966fce94ecf012b8983dc5de78f09846.png

needs a slight tweak to cope with noise from a nearby servo driver but it works, next to build the IR sensors.

 

managed to get JMRI to see multiple physical blocks as a logical section

 

What is that diagram showing?

I don't recognise the orange items

Link to post
Share on other sites

  • RMweb Premium
38 minutes ago, AndyID said:

 

Current transformer.

Never seen it shown on an electrical diagram like that!

It's certainly not one of the standard depictions (IEC, ANSI etc.)

Link to post
Share on other sites

1 hour ago, melmerby said:

Never seen it shown on an electrical diagram like that!

It's certainly not one of the standard depictions (IEC, ANSI etc.)

 

to be fair MS Paint isn't exactly known for circuit drawing but it was to hand, yes current transformer.

 

have had a few other ideas on the detection circuit side of this which I'll be experimenting with which is likely to cut out the ADC module

Link to post
Share on other sites

6 hours ago, gwrcollet said:

you can use IR sensor, better still use a new block current sensing, telling

the loco too slow downand then  to  stop when entering the next block,                                           this can be part of the main block. all locos will stop in the same place,  mackenzie

railway uses ir sensor and chadwick railway will be useing current sensing as stop

markers

 

I did wonder about just having more blocks and working it that way I have to say - when I started out I wasn't too sure how well the block detection would work so thought of the split with both block and IR sensors, I think on a larger layout I'd just use the block ones

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...