Reversin loop automation

Erik84750 May 17, 2017

  1. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    Hi Vasilis, thank you for your constructive approach and for your thinking through on this subject!

    I will read thoughtfully on your comments, a first reading shows very interesting and practical proposals, I will take some time to read throught them.
    Since model railroading is a passionate subject for which however I only sparingly have time due to busy professional obligations I cannot promise when I will address your post in full but rest assured, I will get engaged in this with you!

    Rgds, Erik
     
    vasilis likes this.
  2. vasilis

    vasilis TrainBoard Member

    110
    39
    10
    The double X-over

    Observations and thoughts

    1. Possible train routes are shown in fig. 1-4

    2. We have two reverse polarity sections, one is the outer arch with the turnouts and the other is the simple crossing. Fig 5

    3. The outer RPS (1) (reverse polarity section) changes his state, when the train is moving through the thrown turnout(s) Fig. 2-4 and remains the same as the state out of the loop, when the train is moving through the closed turnouts A,B. Fig. 1. Let’s say LSTATE1=1 and LSTATE1=0 respectively. So, if we will set the turnouts A,B closed or thrown simultaneously the LSTATE1 must be 0, when both are closed and 1 when both are thrown. This is important if we want to change the LSTATE1 with the relay switched by a microswitch. Iin this case only one turnout (A or B) has its microswitch switching the relay. Otherwise we have to add two more sensors E1, E2 at the ends of turnouts A and B and we can them independently, but we have to control the relay with an Arduino pin.

    4. The crossing’s RPS (2) changes his state according the direction the train is moving into it. Let’s say LSTATE2=0 when the train is moving in the direction BC (CB) and LSTATE2=1 when the train is moving in the direction AD (DA).

    5. The minimum of sensors, needed to detect moving in the RPS1 a RPS2, is shown in the fig. 5


    a. Variation with more sensors


    The train enters either from A or B with the turnout closed. The sensor A1 or B1 is activated and the LSTATE1=0 (LSTATE2=0 or 1, it doesn’t matter). Arduino sets the pin, which controls the relay, low and the relay is open. The train is passing over the sensor E1 or E2 and the turnout C goes closed by a pin from arduino.


    The train exits either from A or B with the turnout closed. The sensor E1 or E2 is activated and the LSTATE1=0 (LSTATE2=0 or 1, it doesn’t matter). Turnout C is already closed. Arduino sets the pin, which controls the relay, low and the relay is open.


    The train enters through thrown turnout A . The sensor A2 is activated and :

    LSTATE1=1,LSTATE2=1 polarity is changed by arduino. Obviously for the RPS2 we need a new pin and a second relay.

    Turnout D goes thrown by Arduino. The train passes over the sensor D2 but is nothing to do.


    The train exits through thrown turnout D . The sensor D2 is activated and :

    LSTATE1=1,LSTATE2=1 polarity is changed by arduino.

    Turnout A goes thrown by Arduino. The train passes over the sensor A2 but is nothing to do.


    The train enters through thrown turnout B. The sensor B2 is activated and :

    LSTATE1=1,LSTATE2=0 polarity is changed by arduino.

    Turnout C goes thrown by Arduino. The train passes over the sensor C2 but is nothing to do.


    The train exits through thrown turnout C . The sensor C2 is activated and :

    LSTATE1=1,LSTATE2=0 polarity is changed by arduino. Turnout A goes thrown by Arduino. The train passes over the sensor B2 but is nothing to do.

    Note :

    - In this variation the turnouts can have random states. Things are chainged when the sensors become active. The turnouts become aligned and the polarity is controlled by the Arduino.


    b. Variation with less sensors

    The only difference is that the A,B goes closed or thrown simultaneously as I described.

    The microswitch of one of them switches the relay for the LSTATE1.


    Done (?)


    The WYE briefly

    The principles are already presented.

    The RPS is on the side of the wye. When the train exits the polarity is changed and matches the outside polarity and the corresponding turnout goes thrown. When the train enters (sensor activated) the polarity is changed and matches the outside polarity and the WYE become aligned with the turnout. BUT if the turnouts become aligned with the WYE’s direction, the mainline becomes unused. So we need two sensors on the WYE’s side to align the turnout only when a train exits.


    Maybe I will examine and the other cases too.

    A note about the relay. The relay’s switching voltage is convenient to be 5v dc as can be powered from the same adapter that powers Arduino. The maximum allowed current in the switched circuit has to be more than the expected peak when a shortcut happens.

    The control of polarity with photosensors is based on the train’s routes and involves the control of the turnouts. It is a more complete approach than an inverser on shortcut and for that more complicated. Nevertheless the control of the turnouts can be omitted with the reversing relay be controlled by the Arduino.
    It seems that the easiest way to solve polarity problems with photosensors (don’t be stingy with the sensors) and Arduino is to make the phototransistors’ comparison and the switching of relay and turnouts with Arduino and the conditional decisions either with Arduino or JMRI (logix) and CMRI. I am noob in all this, but I like experimenting.

    We are in a big playground created by people who freely share their work.

    Gentlemen, you have the ball .

    Vasilis
     

    Attached Files:

    Erik84750 likes this.
  3. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    Hi Vasilis, very interesting thoughts and ideas! I will need to take time to read through your very well thought about reasonings.

    Just one comment, as a first: I think last year I made a controller board for reversing loops purely with either optical sensors and with current sensors, without use of a microcontroller; somewhere here I have a post on this, and I also posted the schematics and printed circuit boards.

    But I will have to dig into the subject again, once I have some more spare time (probably during coming summer); I will for sure get in touch with you, kind rgds, Erik
     
    vasilis likes this.
  4. vasilis

    vasilis TrainBoard Member

    110
    39
    10
    Hi Erik,
    If You want to find an universal solution for the polarity issues, plug and play without much thinking and „blind“ wiring, then You have to stay with what a reverser does.

    I attempted to make clear the factors that are involved to this problem and the relationships between them. Maybe i had to stay with a KISS approach and try to put the question this way:

    “how to set the polarity in a reverse section when the train approaches (sensor activated on one side of the gap) the gap between the reverse section and the outer line?I don’t care about the turnouts’ states or anything else, just I want the polarity at the other side of the gap matches the polarity at the other side.”

    So the input consists of the sensor activation at the one side of the gaps and the polarity out of the reverse section at the certain gap. Then the polarity of the reverse section changes to the polarity at the other side of the gap. The reverse section has at least two gaps and the polarity in the RS only two states, so You have to switching between them, but… As I mentioned, You have to make a decision based on the certain gap (where one of the sensors is activated) and based on the polarity out of the RS at the certain gap. I’m sure that can be done with a logical circuit, but I haven’t that knowledge. Imagine that You have to power the RS from the line out of the certain gap only, all the other connections at the rest of the gaps must be open. I don’t see where an occupancy detector helps .

    Attached is a simplified approach. I found the one pulse latching sircuit in a site. The original was one push button latching circuit and i modified it a little. I didn’t check it, but a friend told me that is ok and i believe him.

    I think the Arduino way is more easy and more open to be connected in a more complex way with open source tools. It’s a hobby and every help to minimize the cost is welcome. Btw I haven’t a layout yet (a lot of the materials are in the loft). I’m trying in TT scale with dcc++ and jmri. I’m new in this amazing world and there are so many things to learn and experimenting with, but i haven't so much free time and money. So I’m doing a little bit off all :D.

    Have fun

    Regards
    Vasilis
     

    Attached Files:

  5. GNMT76

    GNMT76 TrainBoard Member

    70
    5
    7
    Very interesting indeed!
     
  6. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    Hi Vasilis,
    thank you for this interesting study!

    I refer back to my post #5 in this response, as well as your post #20.

    A loop consisting of a switch after which a reversing loop is placed with an A-side (suppose this to be to the left of the switch when viewing towards the loop from the switch) and a B-side (to the right of the switch). This loop is electrically isolated from the switch, but connected with a double pole double throw relay (the center poles are connected to the switch tracks and then the left and right pole pairs are connected to the A and B tracks allowing for the loop track polarity to be reversed).

    I will use your definition of loop states, ie. LSTATE=0 means the A-side of the loop is electrically alligned with the outside of the loop (default state at startup) and LSTATE=1 means the B-side of the loop is electrically alligned with the outside of the loop.

    1. This means that any train leaving or entering the loop will do so with electrically alligned tracks.

    2. Two sensors are now placed at the B-side of the loop isolation: one sensor each right before and right after this isolation.

    3. When a train passes over the A-side isolation nothing happens: the tracks already are alligned (default state).

    4. When a train passes over the B-side, either from the switch side or from the loop side) either of the sensors (depending from wich side the train comes) is activated first, subsequently the other sensor is activated as the train passes over the isolation.
    As soon as a sensor is activated, the realy is switched and the loop polarity is alligned between the B-side and the main track.

    Can it be simpler?
     
  7. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    Hi Vasilis, if you use a dafault state (ie LSTATE=0) then one side (from your post #20 the A-side) does not need any action because polarity already is alligned.
    Only when a train wants to cross over the B-side is action needed. Consequently you only need to detect train presence at the B-side isolation gap (both sides, hence two sensors).
    Right?
     
  8. vasilis

    vasilis TrainBoard Member

    110
    39
    10
    :eek::ROFLMAO::ROFLMAO::ROFLMAO::ROFLMAO::ROFLMAO:
    Welcome Erik.
    I have to print and read everything i wrote. :ROFLMAO::ROFLMAO::ROFLMAO:
    I will try tomorrow.
     
  9. vasilis

    vasilis TrainBoard Member

    110
    39
    10
    Erik three questions first.
    Do you switching the turnout manualy or by sensors?
    The train enters the loop from the B (LSTATE=1). How do you make the change (i suppose you do it if you want to exit from the A) to the LSTATE=0 and when?
    Do you know the LSTATE when you power on the track and how?
     
  10. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    Hi Vasilis,

    1. both are possible. If/when the sensors are used then the switch default state is recommended to be towards the A-section of the loop (where the isolation gap without sensors is situated), and the 2 sensors in the B-section command the turnout (switch) for trains leaving the loop. In that case it is recommended to use a logical OR gate (can be done with 2 diodes) so that a third party controller can command that switch too. For incoming trains and using just two sensors it is not possible to command the switch automatically with these 2 sensors. If you need automati control however than that can be done too; just keep the OR-gate so that the switch also can be commanded by outgoing trains on the B-section.

    2. The double pole double throw relay has a "rest" state, ie when no power is applied to the relay coil; That is the default state where polarity between loop and main track must be alligned (just wire the main track rails to the corresponding A-section rails on the relay default contacts).

    3. Yes you do: this is the default (or rest) state of the unpowered relay. The relay only receives power when either of the B-section sensors are activated.

    Grts,
    Erik
     
  11. vasilis

    vasilis TrainBoard Member

    110
    39
    10
    Hi Erik, now i can answer to your question. Yes my way is simplier.:ROFLMAO:
    Ok, seriously, i don't see any logical problem. Imho there is a problem with the probable changes of the sensors during the pass of the train, because they can change it's state between the cars or under open deck cars. This causes unpleasant changes to the LSTATE and to the turnout position resulting to shortcuts and derailments.
    From the begining i had in mind a universal approach that replaces the shortcut event with a sensor event which capture the intention of the train. Once the sensor is activated the LSTATE is changed and then the sensor could have any state without changing the LSTATE. This may seem too much for the simple loop with one turnout, but it can guarantee that the LSTATE will have the correct value.
    Your triggering mechanism is based on the two states of one turnout in this simple loop. Ok, but you have to ensure when the sensor is uncovered the train is completely in the loop or out of the loop.

    Rgds
    Vasilis
     
  12. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    Great answer! Your comment is entirely valid. However, I did take that into account with the 2-sensor electronic circuit I had designed (see post #4). This circuit includes a delay covering your valid concern.
     
  13. vasilis

    vasilis TrainBoard Member

    110
    39
    10
    I hesitate to agree. The delay maybe in a first glance solves the problem, but what will happen if the train will stop and bridging the gap with the sensors uncovered. It's impossible?
    Now i'm curious to know why you choose this way. I use 2 sensors like you and they are close each other plus I haven't to care about oddities.
     
  14. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    Should that matter? Once the locomitive(s) pass, the polarity is of no importance; if the locomotive(s) stand still above the sensors at least one of them will be activated, keeping polarity correct.
     
  15. vasilis

    vasilis TrainBoard Member

    110
    39
    10
    You know if it will work. What if you have cars with lights? The problem isn't the shortcut only, but If your train stops and the sensors will be uncovered then the turnout will turn to A with the train on it. I think it isn't booletproof.
     
  16. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    If cars have lights they will just as well be powered: for lighting it does not matter I think what the polarity is. For switch operation you are right: it is not bulletproof when using light detection.
    In my post #4 I proposed however another circuit, using current detection: that would cover your issues I think.
     
  17. vasilis

    vasilis TrainBoard Member

    110
    39
    10
    Good morning. A car with lights and electrical pickup from both wheelsets can cause a shortcut when bridging opposite polarities.
    I don't know where an occupancy detector helps, it will show the loop occupied when at least a wheelset is in the loop.
    This is a dissect where no more parts to cut.:LOL:
    The train is out of the loop and enters the loop, we know the polarity because we know the position of the turnout. We set the loop's polarity same as the turnout's polarity.
    The train is in the loop and we don't know the exit point. So we have to detect the train before bridge the gap and set the turnout and the loop's polarity.
    Detection failure is allways present and I mentioned this, but i t is less probable, because the sensor has to work once and not during the pass of the whole train. All the time I have in mind the replacement of the shortcut detection with the position detection and from my view this is the way to go. :)
     
  18. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    Correct.
    Can you please elaborate this last paragraph? Which sensor do you refer to? Also "position detection": what do you refer to?
     
  19. vasilis

    vasilis TrainBoard Member

    110
    39
    10
    As sensor i mean the ambient light position detection. It is a position detection because is a point detector. The occupancy detector is a sector detector, it detects the presence within a part of track.
    With the sensors placed at both ends of the loop at the loop side it is enough for the sensor to work once (when the train is going to exit from this point) and then the turnout and the polarity changes to match. Did i understand your question?
     
  20. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    You propose on position (light?) sensor on each end of the loop? At the inside of the loop isolation gaps?
     

Share This Page