IR Speed Detector for model railway

Discussion in 'The Projects Forum' started by flashman99, Mar 10, 2016.

  1. flashman99

    Thread Starter Member

    Mar 10, 2016
    35
    2
    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.
     
  2. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,826
    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"
     
  3. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,175
    397
    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.?
     
  4. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,804
    1,105
    Wouldn't a passive tilt system be simpler, with each carriage being mounted to act as a damped pendulum?
     
    JohnInTX likes this.
  5. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,363
    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.
     
  6. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,804
    1,105
    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?
     
  7. crutschow

    Expert

    Mar 14, 2008
    13,031
    3,240
    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?
     
    Tonyr1084 likes this.
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    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.
     
  9. crutschow

    Expert

    Mar 14, 2008
    13,031
    3,240
    That will tell you how much to tilt but how will that tell you when to operate the tilt?
     
    Tonyr1084 likes this.
  10. bertz

    Member

    Nov 11, 2013
    238
    31
    Check this out. Perhaps you could adapt it to suit your requirement.

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

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    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)
     
  12. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,440
    368
    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: Mar 12, 2016
    Tonyr1084 likes this.
  13. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,826
    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-ADXL3...625144?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
     
    Bernard and blocco a spirale like this.
  14. flashman99

    Thread Starter Member

    Mar 10, 2016
    35
    2
    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.
     
  15. flashman99

    Thread Starter Member

    Mar 10, 2016
    35
    2
    Exactly like a motor cycle, yes.
     
  16. flashman99

    Thread Starter Member

    Mar 10, 2016
    35
    2
    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.
     
  17. flashman99

    Thread Starter Member

    Mar 10, 2016
    35
    2
    How would I measure the pulse width?
     
  18. flashman99

    Thread Starter Member

    Mar 10, 2016
    35
    2
    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.
     
  19. flashman99

    Thread Starter Member

    Mar 10, 2016
    35
    2
    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.
     
  20. flashman99

    Thread Starter Member

    Mar 10, 2016
    35
    2
    DC initially but DCC would be something I would like to use in the future.
     
Loading...