DCC++ and auto-reverse question

Erik84750 Apr 28, 2017

  1. Erik84750

    Erik84750 TrainBoard Member

    151
    66
    8
    DCC++ uses polarity neutral tracks: ie. no DC is measured, instead a PWM signal is superimposed on 0V DC thereby 1. provide power in AC block wave format and 2. provide signals in PWM format on this block wave to decoders.

    Now when a decoder receives a "forward" message it sends a loco from A to B and when it receives a "reverse" signal the loco goes from B to A.

    When this same loco is lifted from the tracks and is placed backwards, the "forward" signal sends it from B to A.

    Now about autoreverse: when a loco enters a reversing loop the track of the loop has to be connected left rail before the loop to left rail in the loop and right to right rail. When the loco continues it gets to the end of the loop where we have the problem of left and right rail: both now have to be reversed so that again left goes back to keft and richt to the right rail.
    When we switch the rails in the loop to match the rails outside the loop (as we should do in a loop to keep the tracks from shorting) we need to bring left in the loop to right and right in the loop to left with the loco stopped: when we restart the loco in the same direction command (forward) the loco will now reverse (I still think, just by reasoning).

    In other words: a loop will make that for the loco to go "forward" we now have to send the command "revers" for the loco to continue on its way.

    1. I feel in my toes something somewhere is wrong in my reasoning: but what?

    2. can we perform auto-reverse of the tracks in the loop on-the-fly with a locomotive running? I.e.: will the decoder compensate for the reversing of tracks underneath it and just continue the loco in the same direction as before?

    Edit: corrected typos

    Thanks!
    Erik
     
    Cymen and Scott Eric Catalano like this.
  2. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    With DCC, the engine moves relative to ITs front and rear. track polarity does not matter, as it changes about 10000 times a second. when you go thru a reversing loop, the auto reverse detects any short circuits, and switches the track polarity to correct the short. worst case, the engine misses a command.

    here is a good read.
    http://www.dccwiki.com/DCC_Power

    when thinking of direction with DCC, think of it regarding the locomotive, not the layout.
     
    Scott Eric Catalano likes this.
  3. Erik84750

    Erik84750 TrainBoard Member

    151
    66
    8
    Thank you for that reply.

    However, is it not preferable to avoid shorts and rather use photocells?
    And when reversing the tracks in the loop, can this be done on-the-fly and have the loco continue on its way?

    I will study the link you provided for further info.

    Rgds,
    Erik
     
    Scott Eric Catalano likes this.
  4. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    the autoreverse circuits work incredibly fast, they usually can detect and correct the short before you even notice anything. You could create a circuit using photo diodes to detect the train in the reversing loop, but the auto reverse circuits work so well, it ends up being an easier solution.
     
    Scott Eric Catalano likes this.
  5. Erik84750

    Erik84750 TrainBoard Member

    151
    66
    8
    After the read I am still left with this question: why would you need an auto-reverser if the controller detects the short and reverses the phases? Or is this what the auto-reverser does?

    In short: if I apply a separate booster for the loop, is it sufficient when detecting a loco in the loop by for example a photocell, to reverse its poles? Such as you would have by using a double pole double throw switch?
     
    Scott Eric Catalano likes this.
  6. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    that is what the auto reverser does, some boosters have this feature built in.
     
    Scott Eric Catalano likes this.
  7. Erik84750

    Erik84750 TrainBoard Member

    151
    66
    8
    The reason I ask these details is that I could simply build my own reverser using a microcontroller that detects a loco with a simple photocell and reverse the poles of the booster in the reversing section. But maybe my whole idea of DCC and reversing loops still is wrong?
     
    Scott Eric Catalano likes this.
  8. Erik84750

    Erik84750 TrainBoard Member

    151
    66
    8
    ..and I am a bit afraid creating shorts on purpose might one day upset a loco decoder?
    And if it is as simple as 1. Detect loco in loop and 2. Reverse poles.. then why not do-it-yourself?
     
    Scott Eric Catalano likes this.
  9. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    You can do it with just a DPDT switch, but that would require manually switching it. Yes, you could do your own. If you always run thru the loop the same direction, you just need to detect when the train is in the loop and switch polarity, and then detect when it has left and switch it back.

    another good read;
    http://www.dccwiki.com/Reverse_Sections
     
    Scott Eric Catalano likes this.
  10. Erik84750

    Erik84750 TrainBoard Member

    151
    66
    8
    And if I would run into the loop from either side, would it be ok ton install a detector on either side at the entrance to the loop?

    And if I do, would it be ok to have the booster feeding the loop to reverse its poles with the loco running? I.e. with the decoder in "forward" command, suddenly reverse the poles and still have the loco running forward?

    I read the DCCwiki post on reverse sections but I sense it to be a bit more marketing than actual technical explanations.

    I just want to say I appreciate tremendously the feedback I am getting here, thank you.
     
    Scott Eric Catalano likes this.
  11. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    as for switching while the loco is moving, worst case is that the loco misses a command, which should not be an issue.

    if your setup worked fast, you could have a photocell under the gap, or one each side of the gap, and have your controller switch the parity to match.

    The reason the commercial versions use a short to detect, easier to install the final product.
     
    Scott Eric Catalano likes this.
  12. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    An arduino has been used as an auto reversing unit for model railroads....a simple google search will turn up a few replies that will point you in the right direction
     
  13. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
  14. Erik84750

    Erik84750 TrainBoard Member

    151
    66
    8
    If I onderstand correctly a auto-reverser for a loop that needs to be approached from both sides:
    1. Needs to detect an incoming train before this loco reaches the isolated loop section
    2. Needs to switch the loop track poles to match the tracks under the incoming loco
    3. Once the loco + wagons are fully on the loop the controller needs to switch the loop booster poles, preferably before, or at the moment the loco hits the photocell at the exit of the loop but before the loco hits the switch at the loop exit/entrance
    4. And I need to assume the loco decoder will not send the loco in reverse due to the poles being switched.

    Is this a correct understanding?

    Thks for all your patience!
    Erik
     
    Scott Eric Catalano likes this.
  15. acptulsa

    acptulsa TrainBoard Member

    2,134
    1,529
    47
    In order for photoelectric sensors to make the thing work, a lot of programming would be needed in order to make decisions about which direction the train is coming, what needs to be reversed, which direction the thing needs to go and all those things you're wondering about. That would be complicated, and require the sensors too.

    Because electronics react so quickly, the designers of the DCC systems skip all that. They set the auto-reversers up to detect the short circuit that naturally happens when a locomotive goes from eastbound to westbound, and trigger the polarity shift at that moment. They keep it simple because that makes it much easier. Because they keep it simple, it's possible for that decision to happen in the blink of an eye.

    It also makes worrying about whether the train is entering the loop or exiting the loop completely moot. When it detects a short circuit, it knows the polarity is wrong and it makes it right. Period. You only need to anticipate when you react slowly enough that you have to be ready to do the complex task to get it done in time. The system reacts in a fraction of a second. So, when it detects a short, it does its thing long before the train stops and the system burns out. Simple, effective, and no specialized, site-specific programming required.

    You might need photoelectric eyes to throw the turnout if you want that done automatically, or to make the crossing signals flash. But the auto-reversing widget honestly doesn't need all that. It detects a short circuit. It flipflops. Done.

    I think the trouble you're having is, you are stuck in DC mode in thinking the polarity of the track has any effect on the motor. It doesn't. When installing DCC, the first thing you do is insulate the motor from the frame and pickups, and wire it to the locomotive's own little board. That on-board brain knows what the polarity of the power it is getting is, converts it to regular DC, and feeds it to the motor. It gets the order 'forward', takes whatever polarity it gets, makes it simple power and feeds the right polarity to the motor to go forward. The system isn't set up to do 'eastbound' and 'westbound'. It only knows 'forward' and 'backward', and that alone is what determines how it feeds the motor.

    With the on-board brain able to take power of any polarity and convert it to simple DC, and feed the right polarity to the motor to go forward or backward on demand, the reversing loop would require no special anything except for one problem--it's still electricity, and connecting one side to the other still creates a short circuit, and locomotive frames and multiple wheels still conduct short circuits. If you could arrange it so your locomotives all had only one axle that picked up electricity, and they actually operated reliably that way, you wouldn't need auto-reversers at all. The one axle would pass over the two insulated rail joiners in a blink of an eye, the locomotive board would adjust to the reversed polarity in a blink of an eye, and that would be that.
     
    Last edited: Apr 28, 2017
  16. Mdwildcat04

    Mdwildcat04 TrainBoard Member

    30
    30
    6
    Also, looks like you can get the digitrax AR1 for $24 if you look around. as much as I like DIY, hard to argue with simple and inexpensive.
     
    Scott Eric Catalano likes this.
  17. acptulsa

    acptulsa TrainBoard Member

    2,134
    1,529
    47
    I wonder if they'd do DC just as well? Set up a loop-to-loop and wire the end loops direct, then wire the single track between them through the auto-reverser. In theory, that would allow continuous running, provided the switches ensured that trains always went through the loops the same direction each time.
     
    Scott Eric Catalano likes this.
  18. Erik84750

    Erik84750 TrainBoard Member

    151
    66
    8
    You have a major point. In fact, I had always learned to tackle the root-cause with any issue, and here it is an electrical issue with shorts on track: solving this involves measuring the short.
    In that the AR1 is probably a good solution except here it would cost me at least €45 to get it delivered, which is why -coupled with my electronics and software enthusiasm- I would like to fabricate it myself.

    So option 1 would be to use an Arduino (pro mini,..) or an ATtiny85 which senses rectified AC voltage and reacts when a short is detected using mosfets to switch. Indeed easier than using photocells.

    But another thing I did learn was to avoid, when possible, the rootcause to appear at all: so in this case: how do I avoid shorts?
    Option 2 would be to use photocells. One cell before each start of the loop (photocells A and B) and one cell inside of the loop (photocell number 1). When cell A detects a loco the loop track power is alligned to that of the A part (left and right tracks are electrically alligned). When cell A is cleared again the polarity gets reversed. Photocell 1 detects the loco and prevents cell B (when the loco exits the loop) from switching again. Cell B is cleared after the loco exits the loop and leaves further down the track. The software routine is ready to start over again, from either side.

    Thank you; this explained some confusion I still must have had.

    Now as a conclusion for this post: would you still choose for option 1?
     
    Last edited: Apr 29, 2017
    Scott Eric Catalano likes this.
  19. Erik84750

    Erik84750 TrainBoard Member

    151
    66
    8
    Right, except here it would cost twice as much. And we are in DCC++ which is by its philosophy all about doing things yourself and not necessarily go the way marketing would like us to go?
     
    Scott Eric Catalano likes this.
  20. Erik84750

    Erik84750 TrainBoard Member

    151
    66
    8
    Solved.

    For a reversing loop all you need is a controller that senses either a short or that uses photocells to reverse the phases in a loop, and since USD25 or in my case €50 is not worth it I fabricated it with €2.5 (USD3) worth of material.

    In my case I prefer not to create shorts when running loco's so I choose the photocell option, as described in my post of yesterday:

    One cell on each leg of the loop right after the switch but before any gap (photocells A and B) and one cell inside of the loop (photocell number 1). When cell A detects a loco the loop track power is alligned to that of the A part (left and right tracks are electrically alligned). When cell A is cleared again the polarity gets reversed. Photocell 1 detects the loco and prevents cell B (when the loco exits the loop) from switching again. Cell B is cleared after the loco exits the loop and leaves further down the track. The software routine is ready to start over again, from either side.

    One ATtiny85 (USD1 delivered home from AliExpress), 3 photoresistors (USD1 for ten pcs), and a 5V powered 10A DPDT relay (USD1).

    The controller works as described in my previous post (half hour of programming and testing), and it works on-the-fly with loco's running in the loop.
     
    Last edited: Apr 30, 2017

Share This Page