IR Speed Detector for model railway

Thread Starter

flashman99

Joined Mar 10, 2016
35
Hi,

I'm working on a project in OO gauge to build an active tilting train. In order to make it realistic I would like to build some form of on-board speed detector that will send information back to the tilt system to activate it when the locomotive reaches a designated speed. I thought about mounting two ir sensors lengthways in the bottom of the loco that pick up the ir signal emission from an ir LED placed in the track a short distance before the bend. The first detector would pick up the ir emission followed by the second further down the loco, the speed being determined by the difference in time between the two detections. The problem is I don't know where to begin or what sort of circuit sophistication would be required. I would like all the electronics to be on board the loco. Any advice would be appreciated.
 

GopherT

Joined Nov 23, 2012
8,012
Hi,

I'm working on a project in OO gauge to build an active tilting train. In order to make it realistic I would like to build some form of on-board speed detector that will send information back to the tilt system to activate it when the locomotive reaches a designated speed. I thought about mounting two ir sensors lengthways in the bottom of the loco that pick up the ir signal emission from an ir LED placed in the track a short distance before the bend. The first detector would pick up the ir emission followed by the second further down the loco, the speed being determined by the difference in time between the two detections. The problem is I don't know where to begin or what sort of circuit sophistication would be required. I would like all the electronics to be on board the loco. Any advice would be appreciated.
You could use the signal from the spinning motor or several others. How much space do you have to do this and, for us non-railroad types, what do you mean by "tilt system"
 

Bernard

Joined Aug 7, 2008
5,364
Maybe a code disc on inside of a wheel on electronics car, read with reflective IR detector for speed.
How to detect a curve ahead?
Use a tilt sensor,( pendulum ), apply enough train tilt to center tilt sensor so that train can take curves at a higher speed. Train tilt something like a motor cycle leaning into a turn.?
 

MrChips

Joined Oct 2, 2009
19,930
Your idea of two photo detectors on the loco is a good idea and a simple one.
However, you don't need two detectors. One will do.
Simply measure the pulse width of the detected signal and you can determine the speed of the loco.
 

Alec_t

Joined Sep 17, 2013
10,739
Have you considered how you will predict/sense whether the train is approaching a curve to the left or a curve to the right, so that the appropriate tilt direction can be obtained?
 

crutschow

Joined Mar 14, 2008
24,122
I would think a tilt sensor (accelerometer) would be the simplest solution. It's completely on-board and requires no external circuits or LEDs, sensing any curves automatically.
For example, here's one with an analog output on a small board.
You use the output to control the tilt mechanism in response to any sideways G forces indicating a curve, to keep the side forces near zero G.

If you tell us what signal the tilt mechanism requires for control of the tilt, we can help you with the circuit.
Is the tilt proportional or on/off?
 

ErnieM

Joined Apr 24, 2011
8,011
What controls the loco's speed? A modern digital command control or old fashioned voltage?

Older voltage control is simple: read the track voltage and convert that to what the tilt controller requires.

Same can be done in dcc if you make a decoder with the same address. Or possibly sample the PCM drive to the motor, convert pulse to dc, and continue on like the above.
 

crutschow

Joined Mar 14, 2008
24,122
What controls the loco's speed? A modern digital command control or old fashioned voltage?

Older voltage control is simple: read the track voltage and convert that to what the tilt controller requires.

Same can be done in dcc if you make a decoder with the same address. Or possibly sample the PCM drive to the motor, convert pulse to dc, and continue on like the above.
That will tell you how much to tilt but how will that tell you when to operate the tilt?
 

bertz

Joined Nov 11, 2013
327
Hi,

I'm working on a project in OO gauge to build an active tilting train. In order to make it realistic I would like to build some form of on-board speed detector that will send information back to the tilt system to activate it when the locomotive reaches a designated speed. I thought about mounting two ir sensors lengthways in the bottom of the loco that pick up the ir signal emission from an ir LED placed in the track a short distance before the bend. The first detector would pick up the ir emission followed by the second further down the loco, the speed being determined by the difference in time between the two detections. The problem is I don't know where to begin or what sort of circuit sophistication would be required. I would like all the electronics to be on board the loco. Any advice would be appreciated.
Check this out. Perhaps you could adapt it to suit your requirement.

http://forum.allaboutcircuits.com/threads/pinewood-derby-stopwatch-timer-project.91433/
 

ErnieM

Joined Apr 24, 2011
8,011
That will tell you how much to tilt but how will that tell you when to operate the tilt?
So using a more complex method to determine speed is preferable if I can tell you where you are?

How about a simple speed input combined with some sort of simple position info, like a light shining up thru the tracks? (you can make the light IR so it is invisible and not violate the principle of KISS)
 

blocco a spirale

Joined Jun 18, 2008
1,546
An optical accellerometer using a pair of photo-diodes/LDRs whereby a suspended shutter causes more light to fall on one than the other when subject to lateral G. The output could feed a window comparator (to provide a mid/neutral deadband) driving an H-bridge, driving a DC motor to tilt the train.

Basically, an adaptation of this old (copied from Elektor) solar tracker circuit:
http://www.homemade-circuits.com/2011/12/how-to-build-dual-solar-tracker-system.html
 
Last edited:

GopherT

Joined Nov 23, 2012
8,012
An optical accellerometer using a pair of photo-diodes/LDRs whereby a suspended shutter causes more light to fall on one than the other when subject to lateral G. The output could feed a window comparator (to provide a mid/neutral deadband) driving an H-bridge, driving a DC motor to tilt the train.

Basically, an adaptation of this old (copied from Elektor) solar tracker circuit:
http://www.homemade-circuits.com/2011/12/how-to-build-dual-solar-tracker-system.html
A 3-axis analog-output accelerometer is also available for $2 from a Chinese seller on eBay (almost 800 units sold).

http://www.ebay.com/itm/GY-61-ADXL335-3-axis-Analog-Output-Accelerometer-Module-for-Arduino-/201383625144?hash=item2ee36641b8:g:uPoAAOSwoudW3RrJ

Looks easy to use. In theory, you would only need one channel plus a pair of power wires of you use the eBay board. If You buy the bare chip, a smaller assembly is possible but you would need some type of board to be fabricated.

https://www.sparkfun.com/datasheets/Components/SMD/adxl335.pdf
 

Thread Starter

flashman99

Joined Mar 10, 2016
35
You could use the signal from the spinning motor or several others. How much space do you have to do this and, for us non-railroad types, what do you mean by "tilt system"
You mean measuring back EMF?

A tilt system is a method of reducing or eliminating the 'G' forces that would affect passenger comfort on a fast train travelling around a bend. In effect it gives the impression that the train is not even on a bend as all or most of the lateral forces have been removed. It enables fast trains on existing railway lines without the need to build new routes without too many bends. In the UK we had the APT-P in the 1970's which never made it into regular service and now we have the Pendolino.
 

Thread Starter

flashman99

Joined Mar 10, 2016
35
Maybe a code disc on inside of a wheel on electronics car, read with reflective IR detector for speed.
How to detect a curve ahead?
Use a tilt sensor,( pendulum ), apply enough train tilt to center tilt sensor so that train can take curves at a higher speed. Train tilt something like a motor cycle leaning into a turn.?
Exactly like a motor cycle, yes.
 

Thread Starter

flashman99

Joined Mar 10, 2016
35
Wouldn't a passive tilt system be simpler, with each carriage being mounted to act as a damped pendulum?
It would but where is the fun in that? :) My prototype is based on the Advanced Passenger Train or APT-E developed by British Rail in the 1970s.
 

Thread Starter

flashman99

Joined Mar 10, 2016
35
Your idea of two photo detectors on the loco is a good idea and a simple one.
However, you don't need two detectors. One will do.
Simply measure the pulse width of the detected signal and you can determine the speed of the loco.
How would I measure the pulse width?
 

Thread Starter

flashman99

Joined Mar 10, 2016
35
Have you considered how you will predict/sense whether the train is approaching a curve to the left or a curve to the right, so that the appropriate tilt direction can be obtained?
I thought about magnets in the track approaching the bend which will close reed relays the tilt circuit. The tilt would vary between 0 and 12 degrees depending on loco speed.
 

Thread Starter

flashman99

Joined Mar 10, 2016
35
I would think a tilt sensor (accelerometer) would be the simplest solution. It's completely on-board and requires no external circuits or LEDs, sensing any curves automatically.
For example, here's one with an analog output on a small board.
You use the output to control the tilt mechanism in response to any sideways G forces indicating a curve, to keep the side forces near zero G.

If you tell us what signal the tilt mechanism requires for control of the tilt, we can help you with the circuit.
Is the tilt proportional or on/off?
Sounds like a good solution, the train will then operate on any layout. I haven't decided on the control mechanism yet, probably electrical actuators or servo motors.
 

Thread Starter

flashman99

Joined Mar 10, 2016
35
What controls the loco's speed? A modern digital command control or old fashioned voltage?

Older voltage control is simple: read the track voltage and convert that to what the tilt controller requires.

Same can be done in dcc if you make a decoder with the same address. Or possibly sample the PCM drive to the motor, convert pulse to dc, and continue on like the above.
DC initially but DCC would be something I would like to use in the future.
 
Top