Reversin loop automation

Erik84750 May 17, 2017

  1. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Hi, some time ago I published a reverse loop control with 3 sensors and microcontroller automation. After much discussions and forum input here and elsewhere I designed a automatic reverse loop control on the following requirements:

    1. not short-circuit based
    2. fully bi-directional (can be entered and/of exited from any direction
    3. applicable to any kind of reverse loop including double crossovers with a reverse loop
    4. any scale
    5. any system: analog or DCC or both
    6. indoor or outdoor
    7. any number of trains allowed inside the loop
    8. any format for reversing loop allowed, including parking tracks, loop inside loop (nested loops), complete tracksystems,..
    9. independent of ambient conditions (light, temperature,..)
    10. not microprocessor controlled
    11. can supply logic level feedbak for buscontrolled systems (ie LOW and HIGH output signals for "detection", "relay activation",.. etc).
    12. full autonomous: the detection system drives the relevant relay for polarity change-over as well as digital status output for control systems

    The general idea is based on the fact that in a reverse loop there always is only ONE side that is going to be shortcircuited if you drive a train over it. So ONLY that one side needs to detect whether there is a train over it to change polarity.

    As far as traindetection is concerned I already have a fully tested detector system based on LDR's which is completely insensitive to lichting condition variations (ie. any change in ambient lighting does not affect detection capability).

    In the drawing I added further detailed specifications and installation requirements.

    Please have a critical look at my idea, any feedback is greatly welcomed!

    reversing loop v3b.jpg
     
    Scott Eric Catalano likes this.
  2. kmcsjr

    kmcsjr TrainBoard Member

    1,702
    60
    32
    I don't have a reverse loop to play with. Could the same idea be applied to throw a switch, when a train approached, from the divergent side and throw it back, when the switch is clear?


    Sent from my iPhone using Tapatalk
     
    Scott Eric Catalano likes this.
  3. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Yes.
    I did post this concept in http://www.rmweb.co.uk/community/index.php?/forum/178-dcc-help-questions/ and after quite a bit of very usefull feedback I will change the concept:

    1. use detectors for both sides for all isolation gaps
    2. try and solve with a monostable relay but with a robust photodetector solution
    3. involve debounce for rising edge to eliminate spurious detection and falling edge delay long enough to cover gaps between wagons, false "no-detections",... . Probably I will resort to a microcontroller besides the photocell detection.

    As a result of all the constructive feedback I will design a photodetector pcb which will output both Vcc (15V, .. whatever) and TTL 5V HIGH/LOW signals; and with the possibility to hardware connect detector outputs on the PCB in OR gates.

    In short: I will design a photocell detector board that will be capable of throwing switches, direct track lichting, etc.. The actual reversing loop control will be adapted per the result of these discussions. I will post the result here when ready.
     
    Scott Eric Catalano likes this.
  4. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    After some weeks of research I developed a schematic based on the work of others (http://home.cogeco.ca/~rpaisley4/DccBODvt5.html, Bruce Chubb's JLC site and his DCCOD board, http://www.model-railroad-infoguy.com/train-detector.html, http://www.mrollins.com/photodet.html, http://www.qtutrains.com/LDR.html,...) that take sinto account all the best from these sources into what I want:
    1. filtering of spurious signals
    2. delayed detection drop-off (adjustable 0 to about 5 seconds)
    3. supply voltage 5 to 18Vdc
    4. open collector output
    5. applicable in commercial train control hardware
    6. independantly applicable in hardware control of signal lights, switches, ..
    7. current detection starting at 1mA
    8. detection in ambient lighting conditions from 20 lux (low level room light)
    9. automatic compensation for changing lighting conditions
    10. TTL output with otput current either max 200mA or max 10A
    11. adjustable sensitivity

    I made a pcb for both detectors, if you want to fabricate your own board just pm me for the .brd file.
     

    Attached Files:

    Scott Eric Catalano likes this.
  5. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    And now for reversing loop automation: just two sensors are needed, one right before and one right after the isolation of one leg (call it leg A) of a reversing loop. A relay reversing the loop polarisation is then driven for as long as one of both sensors detect something. If nothing is detected then the relay is in rest position and the loop polarisation is not reversed, and trains can happily enter and leave across the B-leg of the loop.

    Not even a controller is needed: just connect one pole of the relay coil to supply voltage, connect the other pole of the relay coil to the detector output; the output will connect to ground anytime the detector is detecting something.

    Voilà.
     
    Last edited: Jun 18, 2017
    Scott Eric Catalano likes this.
  6. JimDo

    JimDo New Member

    3
    1
    5
    Has anyone done this? I don't see this working based on diagram 1. Is "as long as one of both" a typo? Do you mean one or both? Polarity must change on the loop while the train is fully in the loop to prevent a short either entering or leaving the loop. How does that happen?
     
  7. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    The concept here is that loop polarity would be by default alligned with the B-leg (the gap between the loop and the B-leg is bridged, the gap between the loop and the A-leg has opposite polarity).
    When either of both detectors on the A-gap detects something (train passing over) then the polarity between the loop and the A-leg is alligned (relay is switched). The relay remains activated (switched, polarities A-leg and loop are alligned) as long as either of both detectors do detect a train over it.

    You could also command the loop-switch with this relay, but than you would need a third detector to make sure the switch is cleared too.

    In another post I also discussed microcontroller loop polarity control, but there I assumed detection using 3 sensors (2 right outside the loop gaps and one inside the loop) but then I had a problem with a train that had entered the loop in its entirity and then wants to reverse. To solve that 2 more sensors are needed rigth inside the loop near each gap.
     
  8. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    -Default polarities leg-B and loop are alligned (relay not activated)
    -Something detected over leg-A sensors (before or after the gap there): polarities leg-A and loop are alligned (relay activated)
     
  9. Greg Elmassian

    Greg Elmassian TrainBoard Member

    325
    62
    17
    I understand autoreversers for DCC, simple just align the loop polarity as the train enters, and align it again as it exits, since the direction of the train is unaffected by the loop polarity.

    How can you make this work for a DC layout unless you are reversing the mainline as you exit the loop?

    Greg
     
  10. JimDo

    JimDo New Member

    3
    1
    5
    I still see a short occurring when the train is straddling the zones even though it will be resolved when the relay flips.
     
  11. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Indeed: for DC, whether autoreverse "manually" or automated, the main track has to be reversed on exit.
     
  12. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    If the two detectors are positioned before and after the gap for leg A there is no reason why there would be a short: detection time instance + debounce time (100ms approx) = reversal time instance
     
  13. Greg Elmassian

    Greg Elmassian TrainBoard Member

    325
    62
    17
    So if you reverse the main line, then this system is only good for a single train on the layout in DC?

    Greg
     
  14. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    I guess so; I designed this for DCC purposes, DC, is not of interest to me anymore.
     
  15. Greg Elmassian

    Greg Elmassian TrainBoard Member

    325
    62
    17
    Ahh... so your first post of the thread, with all the specifications and functions is no longer valid?

    OK, so this is now a DCC only autoreverser?

    Did you build this yet? Is there a list of updated functions/specifications?

    Greg
     
  16. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    My first post and the specs written there still are valid, also for DC use. I posted my work after rigorous testing for anyone to use, free of charge. If you prefer fully documented and ready-to-install equipment I refer you to commercial suppliers.
    If you expect me to explain how my design works I suggest you start reading my posts. If you expect me to justify anything I posted here I suggest you try it out yourself.
     
  17. Greg Elmassian

    Greg Elmassian TrainBoard Member

    325
    62
    17
    Sorry, confused, your last post says valid for DC use, and then your post above says "I designed this for DCC purposes, DC, is not of interest to me anymore."

    So one of your posts says DC valid, the other no DC.

    I've been following the thread and you have been more concerned about detection rather than sharing the logic of your circuit or the circuit itself.

    Remember, you started this thread to extoll the ambitious project you undertook, why the hostility when questions about how it works or things that don't make sense?


    Greg
     
  18. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    You are the one insisting it "does not work for DC because you can run only one train" on your layout. My initial post does not claim it works for more than one train in DC. By the nature of DC this is the way this works, whether you automate reversing sections or not. But my project does indeed work for DC.

    Your comment does not make sense.

    Your statement is a personal judgement on which I do not comment. I did a lot of work on building a detection circuit: researching, designing the circuit, designing pcb's, testing, manufacturing the pcb's etc.. And because I receive a lot of usefull feedback on this forum I decided to publicly release my work for others to use. For free, no limitations.

    I always will answer open questions, not statements denigrating my work. Your statement above shows you are more interested in finding personal issues rather than focusing on the contents of what I posted. I tried to be polite in my previous post, you obviously do not get it.


    Again, I think you do not understand that the contents you post here is actually condescending and smell of personal attack. Things that do not make sense? If you do not understand electronic circuitry then you may want to study this subject before making statements that do not make sense.
     
  19. Greg Elmassian

    Greg Elmassian TrainBoard Member

    325
    62
    17
    I was really trying to understand what you were designing, and in my opinon, the logic required to have this work is much more difficult than the detection, and as you have shown, you can use different detection mechanisms.

    But none of your drawings showed reversing the main line, so when I asked about this, you replied that you were no longer interested in DC. So then I went back to your "design specifications" at the beginning of the thread, so to get "updated" on what you were designing.

    That's where I ran into your contradiction. You took this personally. Sorry you did that. But you also realize this is a public forum, and if you cannot abide questions (and also constructive criticism) you will have difficulty.

    So that's it. Sorry you take these questions trying to understand where you are going and how as condescending. And I will state something I'm sure you will be upset about, asking questions that point out an oversight or flaw is not "denigrating" I suggest you look up the definition of the word.

    Greg
     
    ViperBugloss likes this.
  20. vasilis

    vasilis TrainBoard Member

    110
    39
    10
    Hi to all.

    First of all I need to make clear that I’m not inventing something, but I just attempt to put together some things that have already been shared by other people.

    I think the Erik’s approach is a very good idea and the major supporting argument is “I don’t want shortcuts”. Maybe it is also cheaper from other implementations.
    Keeping in mind that every preventing system needs a second and maybe a third backup system, because of Murphy rules, I will attempt to set things of my point of view and only for DCC and arduino.


    1. The polarity in the loop has two states. Let’s say var LSTATE=0, when the polarity is the same with the polarity at the end A outside of the loop and LSTATE=1 at the end B. Assume that the default polarity at power-on is the same outside the loop at end A.

    2. The loop’s polarity has to be changed to the polarity at the ends of the loop when a train is approaching the loop’s end either from inside or outside the loop.

    1st approach

    So I need to know a train’s “intention”. For that I need two sensors at each end, one outside the loop, before the gap and one inside, after the gap.
    When one of sensors at the end A is activated and the var LSTATE=0, the loop’s polarity is already aligned so nothing to do. If the LSTATE=1 then send a pulse to relay’s latching circuit to change the polarity and set LSTATE=0. At this moment I have to notice that the turnout must be in correct position when the train exits the loop to avoid a derailment. That point can easily be part of automation, but I don’t want to mess with this now.

    When one of sensors at the end B is activated and the var LSTATE=1, the loop’s polarity is already aligned so nothing to do. If the LSTATE=0 then send a pulse to relay’s latching circuit to change the polarity and set LSTATE=1.

    The position of the turnout or turnouts, at the loop’s ends, can change accordingly. I’m not going to the details because it is easy to achieve (pulse to servo), but we have to consider the feedback (a micro switch can be used or a pin from arduino) to the control station and this can be a little tricky and depends on the command station and the way how we want to control the layout. Finally the control of the turnouts and the feedback to the station have no impact to this approach, I think…


    2nd approach

    Let’s say now, that we know the loop’s end the train goes through because of knowing the turnout’s state, so the loop’s polarity is the same as the turnout’s polarity. Let’s assume that we have a servo controlled turnout with one microswitch (SPDT) changing the frog’s polarity and a second microswitch to control a DPDT relay that powering the loop and sets an arduino pin low (high) that means that turnout is aligned with end A (B) and var LSTATE=0(1). The same microswitch can send a feedback to the command station. The turnout servo is controlled by an arduino pin too.

    In case we have two turnouts, one at each end of the loop (reverse section), they must be controlled simultaneously in a way that only one of them at the time is aligned with the loop and one of them is equipped with the microswitch which controls the relay and signals the state.


    The train enters the loop through end A. Turnout is aligned with end A, microswitch is not powering the relay so the polarity is the same as the turnout’s (A) (because of have been wired this way), arduino pin is low and LSTATE=0. Then the sensor became active, but there is nothing to do because of LSTATE=0.

    The train enters the loop through end B. Turnout is aligned with end B, microswitch is powering the relay so the polarity is the same as the turnout’s (B) (because of have been wired this way), arduino pin is high and LSTATE=1. Then the sensor became active, but there is nothing to do because of LSTATE=1.

    The train exits the loop through end A. Sensor is activated.
    a) If LSTATE=0 nothing to do.
    b) if LSTATE=1 then align the turnout with loop’s end A.


    The train exits the loop through end B. Sensor is activated.
    a) If LSTATE=1 nothing to do.
    b) if LSTATE=0 then align the turnout with loop’s end B.


    I prefer this approach
    Done (?)

    Erik, I think you have used slightly different variations of these approaches.
    You can also do the phototransistors’ comparison of each sensor with arduino as described here: http://trainelectronics.com/Crossing_Signal_sensor/DifferentialDetector/


    As for the photosensors’ external comparison I will stand for the Geoff’s Bunza version where the second, reference, phototransistor is on the side of the track and modified with a transistor to give high output when sensor is activated.

    http://model-railroad-hobbyist.com/node/26133

    I believe that the described approach can be applied to all cases that have sections where the polarity has to be inverted, under two conditions: a) the wiring must be clear and the reverse sections too. b) the train’s length must fit in the reverse section. I like the term “reverse section” as more suitable and comprehensive. I have to admit that this approach needs a little more thinking for the wiring, but it is more flexible, I think…
    A study on the application of the certain approach in the most common cases of reverse sections, but I’m exhausted after all that babble.


    Some people think that the “on shortcut polarity reverser” is the medicine for the wrong wiring and finally they achieve switching between shortcuts.

    I admire the people who share his work and I’m thankful for that. Sorry if the English language became a victim, it isn’t my native.

    Have fun!

    Vasilis

    PS babling attempts landing to the paper. hopefully i will upload and other sketches
     

    Attached Files:

    Last edited: Jun 3, 2018

Share This Page